From 96e0d0109b0eaf971b75648b11754ead98aa7dc6 Mon Sep 17 00:00:00 2001 From: John Dewey Date: Mon, 7 Jan 2013 17:33:13 -0800 Subject: [PATCH] Re-Revert "Revert "Foodcritic cleanups"" This reverts commit 681aa57270aa1bcfe9bbb8673584fce012882d60. Corrected the notification syntax --- attributes/default.rb | 2 +- recipes/api-ec2.rb | 4 ++-- recipes/api-metadata.rb | 4 ++-- recipes/api-os-compute.rb | 4 ++-- recipes/compute.rb | 2 +- recipes/libvirt.rb | 6 +++--- recipes/network.rb | 2 +- recipes/nova-cert.rb | 2 +- recipes/nova-common.rb | 13 ++++++------- recipes/scheduler.rb | 2 +- recipes/vncproxy.rb | 4 ++-- templates/default/nova.conf.erb | 4 ++-- .../default/{rootwrap.conf => rootwrap.conf.erb} | 0 ...pi-metadata.filters => api-metadata.filters.erb} | 0 .../{compute.filters => compute.filters.erb} | 0 .../{network.filters => network.filters.erb} | 0 16 files changed, 24 insertions(+), 25 deletions(-) rename templates/default/{rootwrap.conf => rootwrap.conf.erb} (100%) rename templates/default/rootwrap.d/{api-metadata.filters => api-metadata.filters.erb} (100%) rename templates/default/rootwrap.d/{compute.filters => compute.filters.erb} (100%) rename templates/default/rootwrap.d/{network.filters => network.filters.erb} (100%) diff --git a/attributes/default.rb b/attributes/default.rb index e96ca32a..88c5424d 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -159,7 +159,7 @@ default["nova"]["ratelimit"]["api"]["enabled"] = true default["nova"]["api"]["signing_dir"] = "/tmp/keystone-sign-nova" case platform -when "fedora", "redhat", "centos" +when "fedora", "redhat", "centos" # :pragma-foodcritic: ~FC024 - won't fix this default["nova"]["platform"] = { "api_ec2_packages" => ["openstack-nova-api"], "api_ec2_service" => "openstack-nova-api", diff --git a/recipes/api-ec2.rb b/recipes/api-ec2.rb index 280e215a..092189a7 100644 --- a/recipes/api-ec2.rb +++ b/recipes/api-ec2.rb @@ -50,7 +50,7 @@ end service "nova-api-ec2" do service_name platform_options["api_ec2_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end @@ -145,5 +145,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, resources(:service => "nova-api-ec2"), :delayed + notifies :restart, "service[nova-api-ec2]" end diff --git a/recipes/api-metadata.rb b/recipes/api-metadata.rb index 9a3777c5..c90df5ec 100644 --- a/recipes/api-metadata.rb +++ b/recipes/api-metadata.rb @@ -50,7 +50,7 @@ end service "nova-api-metadata" do service_name platform_options["nova_api_metadata_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end @@ -72,5 +72,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, resources(:service => "nova-api-metadata"), :delayed + notifies :restart, "service[nova-api-metadata]" end diff --git a/recipes/api-os-compute.rb b/recipes/api-os-compute.rb index e89a0a8e..a92f2c37 100644 --- a/recipes/api-os-compute.rb +++ b/recipes/api-os-compute.rb @@ -50,7 +50,7 @@ end service "nova-api-os-compute" do service_name platform_options["api_os_compute_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end @@ -144,5 +144,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, resources(:service => "nova-api-os-compute"), :delayed + notifies :restart, "service[nova-api-os-compute]" end diff --git a/recipes/compute.rb b/recipes/compute.rb index 90734425..f7d1fd45 100644 --- a/recipes/compute.rb +++ b/recipes/compute.rb @@ -54,7 +54,7 @@ end service "nova-compute" do service_name platform_options["nova_compute_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end diff --git a/recipes/libvirt.rb b/recipes/libvirt.rb index e1a8917a..4e3cae07 100644 --- a/recipes/libvirt.rb +++ b/recipes/libvirt.rb @@ -78,7 +78,7 @@ template "/etc/libvirt/libvirtd.conf" do :auth_tcp => node["nova"]["libvirt"]["auth_tcp"] ) - notifies :restart, resources(:service => "libvirt-bin"), :immediately + notifies :restart, "service[libvirt-bin]", :immediately end template "/etc/default/libvirt-bin" do @@ -87,7 +87,7 @@ template "/etc/default/libvirt-bin" do group "root" mode 00644 - notifies :restart, resources(:service => "libvirt-bin"), :immediately + notifies :restart, "service[libvirt-bin]", :immediately only_if { platform? %w{ubuntu debian} } end @@ -98,7 +98,7 @@ template "/etc/sysconfig/libvirtd" do group "root" mode 00644 - notifies :restart, resources(:service => "libvirt-bin"), :immediately + notifies :restart, "service[libvirt-bin]", :immediately only_if { platform? %w{fedora redhat centos} } end diff --git a/recipes/network.rb b/recipes/network.rb index 06c3a271..3751622a 100644 --- a/recipes/network.rb +++ b/recipes/network.rb @@ -32,7 +32,7 @@ end service "nova-network" do service_name platform_options["nova_network_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end diff --git a/recipes/nova-cert.rb b/recipes/nova-cert.rb index d8bc7cad..2a7bd54c 100644 --- a/recipes/nova-cert.rb +++ b/recipes/nova-cert.rb @@ -31,7 +31,7 @@ end service "nova-cert" do service_name platform_options["nova_cert_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 8dde162e..8584fc4a 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -103,13 +103,14 @@ template "/etc/nova/nova.conf" do mode 00644 variables( :sql_connection => sql_connection, - :vncserver_listen => "0.0.0.0", :vncserver_proxyclient_address => novnc_proxy_endpoint.host, :novncproxy_base_url => novnc_endpoint.to_s, :xvpvncproxy_bind_host => xvpvnc_endpoint.host, :xvpvncproxy_bind_port => xvpvnc_endpoint.port, :xvpvncproxy_base_url => xvpvnc_endpoint.to_s, :rabbit_ipaddress => rabbit_info["host"], + #TODO(retr0h): Will be changed with our HA work + :rabbit_password => "guest", :rabbit_port => rabbit_info["port"], :identity_endpoint => identity_endpoint, # TODO(jaypipes): No support here for >1 image API servers @@ -122,7 +123,7 @@ template "/etc/nova/nova.conf" do end template "/etc/nova/rootwrap.conf" do - source "rootwrap.conf" + source "rootwrap.conf.erb" # Must be root! owner "root" group "root" @@ -130,7 +131,7 @@ template "/etc/nova/rootwrap.conf" do end template "/etc/nova/rootwrap.d/api-metadata.filters" do - source "rootwrap.d/api-metadata.filters" + source "rootwrap.d/api-metadata.filters.erb" # Must be root! owner "root" group "root" @@ -138,7 +139,7 @@ template "/etc/nova/rootwrap.d/api-metadata.filters" do end template "/etc/nova/rootwrap.d/compute.filters" do - source "rootwrap.d/compute.filters" + source "rootwrap.d/compute.filters.erb" # Must be root! owner "root" group "root" @@ -146,7 +147,7 @@ template "/etc/nova/rootwrap.d/compute.filters" do end template "/etc/nova/rootwrap.d/network.filters" do - source "rootwrap.d/network.filters" + source "rootwrap.d/network.filters.erb" # Must be root! owner "root" group "root" @@ -167,14 +168,12 @@ template "/root/openrc" do :tenant => ksadmin_tenant_name, :password => ksadmin_pass, :identity_admin_endpoint => identity_admin_endpoint, - :nova_api_ipaddress => nova_api_endpoint.host, :nova_api_version => "1.1", :auth_strategy => "keystone", :ec2_url => ec2_public_endpoint.to_s ) end - execute "enable nova login" do command "usermod -s /bin/sh nova" end diff --git a/recipes/scheduler.rb b/recipes/scheduler.rb index 08f44f1b..e7f49d91 100644 --- a/recipes/scheduler.rb +++ b/recipes/scheduler.rb @@ -40,7 +40,7 @@ end service "nova-scheduler" do service_name platform_options["nova_scheduler_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action [:enable, :start] end diff --git a/recipes/vncproxy.rb b/recipes/vncproxy.rb index 6f986252..08eaff66 100644 --- a/recipes/vncproxy.rb +++ b/recipes/vncproxy.rb @@ -39,7 +39,7 @@ end service "nova-vncproxy" do service_name platform_options["nova_vncproxy_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action :enable end @@ -47,7 +47,7 @@ end service "nova-consoleauth" do service_name platform_options["nova_vncproxy_consoleauth_service"] supports :status => true, :restart => true - subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed + subscribes :restart, resources("template[/etc/nova/nova.conf]") action [ :enable, :start ] end diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb index 26f605fd..6abe8999 100644 --- a/templates/default/nova.conf.erb +++ b/templates/default/nova.conf.erb @@ -16,8 +16,8 @@ state_path=/var/lib/nova lock_path=/var/lock/nova ##### RABBITMQ ##### -rabbit_password=guest -rabbit_port=5672 +rabbit_password=<%= @rabbit_password %> +rabbit_port=<%= @rabbit_port %> rabbit_host=<%= @rabbit_ipaddress %> ##### SCHEDULER ##### diff --git a/templates/default/rootwrap.conf b/templates/default/rootwrap.conf.erb similarity index 100% rename from templates/default/rootwrap.conf rename to templates/default/rootwrap.conf.erb diff --git a/templates/default/rootwrap.d/api-metadata.filters b/templates/default/rootwrap.d/api-metadata.filters.erb similarity index 100% rename from templates/default/rootwrap.d/api-metadata.filters rename to templates/default/rootwrap.d/api-metadata.filters.erb diff --git a/templates/default/rootwrap.d/compute.filters b/templates/default/rootwrap.d/compute.filters.erb similarity index 100% rename from templates/default/rootwrap.d/compute.filters rename to templates/default/rootwrap.d/compute.filters.erb diff --git a/templates/default/rootwrap.d/network.filters b/templates/default/rootwrap.d/network.filters.erb similarity index 100% rename from templates/default/rootwrap.d/network.filters rename to templates/default/rootwrap.d/network.filters.erb