diff --git a/attributes/default.rb b/attributes/default.rb index 88c5424d..e96ca32a 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" # :pragma-foodcritic: ~FC024 - won't fix this +when "fedora", "redhat", "centos" 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 2bd8ddd5..280e215a 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end @@ -145,5 +145,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, service['nova-api-ec2'] + notifies :restart, resources(:service => "nova-api-ec2"), :delayed end diff --git a/recipes/api-metadata.rb b/recipes/api-metadata.rb index 03127781..9a3777c5 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end @@ -72,5 +72,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, service['nova-api-metadata'] + notifies :restart, resources(:service => "nova-api-metadata"), :delayed end diff --git a/recipes/api-os-compute.rb b/recipes/api-os-compute.rb index 847d8ef8..e89a0a8e 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end @@ -144,5 +144,5 @@ template "/etc/nova/api-paste.ini" do "service_password" => service_pass ) - notifies :restart, service['nova-api-os-compute'] + notifies :restart, resources(:service => "nova-api-os-compute"), :delayed end diff --git a/recipes/compute.rb b/recipes/compute.rb index 01880607..90734425 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end diff --git a/recipes/libvirt.rb b/recipes/libvirt.rb index 836c2a70..e1a8917a 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, service['libvirt-bin'], :immediately + notifies :restart, resources(: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, service['libvirt-bin'], :immediately + notifies :restart, resources(: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, service['libvirt-bin'], :immediately + notifies :restart, resources(:service => "libvirt-bin"), :immediately only_if { platform? %w{fedora redhat centos} } end diff --git a/recipes/network.rb b/recipes/network.rb index 905796fb..06c3a271 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end diff --git a/recipes/nova-cert.rb b/recipes/nova-cert.rb index 1704fb06..d8bc7cad 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action :enable end diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 8584fc4a..8dde162e 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -103,14 +103,13 @@ 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 @@ -123,7 +122,7 @@ template "/etc/nova/nova.conf" do end template "/etc/nova/rootwrap.conf" do - source "rootwrap.conf.erb" + source "rootwrap.conf" # Must be root! owner "root" group "root" @@ -131,7 +130,7 @@ template "/etc/nova/rootwrap.conf" do end template "/etc/nova/rootwrap.d/api-metadata.filters" do - source "rootwrap.d/api-metadata.filters.erb" + source "rootwrap.d/api-metadata.filters" # Must be root! owner "root" group "root" @@ -139,7 +138,7 @@ template "/etc/nova/rootwrap.d/api-metadata.filters" do end template "/etc/nova/rootwrap.d/compute.filters" do - source "rootwrap.d/compute.filters.erb" + source "rootwrap.d/compute.filters" # Must be root! owner "root" group "root" @@ -147,7 +146,7 @@ template "/etc/nova/rootwrap.d/compute.filters" do end template "/etc/nova/rootwrap.d/network.filters" do - source "rootwrap.d/network.filters.erb" + source "rootwrap.d/network.filters" # Must be root! owner "root" group "root" @@ -168,12 +167,14 @@ 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 12e733aa..08f44f1b 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action [:enable, :start] end diff --git a/recipes/vncproxy.rb b/recipes/vncproxy.rb index 825e8850..6f986252 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed 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']") + subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed action [ :enable, :start ] end diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb index 6abe8999..26f605fd 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=<%= @rabbit_password %> -rabbit_port=<%= @rabbit_port %> +rabbit_password=guest +rabbit_port=5672 rabbit_host=<%= @rabbit_ipaddress %> ##### SCHEDULER ##### diff --git a/templates/default/rootwrap.conf.erb b/templates/default/rootwrap.conf similarity index 100% rename from templates/default/rootwrap.conf.erb rename to templates/default/rootwrap.conf diff --git a/templates/default/rootwrap.d/api-metadata.filters.erb b/templates/default/rootwrap.d/api-metadata.filters similarity index 100% rename from templates/default/rootwrap.d/api-metadata.filters.erb rename to templates/default/rootwrap.d/api-metadata.filters diff --git a/templates/default/rootwrap.d/compute.filters.erb b/templates/default/rootwrap.d/compute.filters similarity index 100% rename from templates/default/rootwrap.d/compute.filters.erb rename to templates/default/rootwrap.d/compute.filters diff --git a/templates/default/rootwrap.d/network.filters.erb b/templates/default/rootwrap.d/network.filters similarity index 100% rename from templates/default/rootwrap.d/network.filters.erb rename to templates/default/rootwrap.d/network.filters