From f62c3e15580aa80b7e6854c07080a7cfcda24519 Mon Sep 17 00:00:00 2001 From: rpedde Date: Tue, 29 May 2012 09:28:29 -0500 Subject: [PATCH] add vncproxy, scheduler options for osops-utils --- attributes/default.rb | 13 ++++++++++++- recipes/api-metadata.rb | 2 +- recipes/nova-common.rb | 2 +- recipes/scheduler.rb | 28 ++++++++++------------------ recipes/vncproxy.rb | 39 ++++++++++++++------------------------- 5 files changed, 38 insertions(+), 46 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index e7b3158c..41487f00 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -102,6 +102,11 @@ when "fedora" "nova_compute_service" => "openstack-nova-compute", "nova_network_packages" => ["openstack-nova"], "nova_network_service" => "openstack-nova-network", + "nova_scheduler_packages" => ["openstack-nova"], + "nova_scheduler_service" => "openstack-nova-scheduler", + "nova_vncproxy_packages" => ["openstack-nova"], + "nova_vncproxy_service" => "openstack-nova-vncproxy", + "nova_vncproxy_consoleauth_packages" => ["openstack-nova"], "libvirt_packages" => ["libvirt"], "libvirt_service" => "libvirtd", "common_packages" => ["openstack-nova"], @@ -123,9 +128,15 @@ when "ubuntu" "nova_compute_service" => "nova-compute", "nova_network_packages" => ["nova-network"], "nova_network_service" => "nova-network", + "nova_scheduler_packages" => ["nova-scheduler"], + "nova_scheduler_service" => "nova-scheduler", + "nova_vncproxy_packages" => ["nova-vncproxy"], + "nova_vncproxy_service" => "nova-vncproxy", + "nova_vncproxy_consoleauth_packages" => ["nova-consoleauth"], + "nova_vncproxy_consoleauth_service" => "nova-consoleauth", "libvirt_packages" => ["libvirt-bin"], "libvirt_service" => "libvirt-bin", "common_packages" => ["nova-common"], - "package_overrides" => "-o Dpkg::Options::='--force-confold'-o Dpkg::Options::='--force-confdef'" + "package_overrides" => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" } end diff --git a/recipes/api-metadata.rb b/recipes/api-metadata.rb index a88fa139..b7649da5 100644 --- a/recipes/api-metadata.rb +++ b/recipes/api-metadata.rb @@ -58,7 +58,7 @@ template "/etc/nova/api-paste.ini" do variables( "component" => node["package_component"], "keystone_api_ipaddress" => ks_admin_endpoint["host"], - "admin_port" => keystone_admin_port, + "admin_port" => ks_admin_endpoint["port"], "service_port" => ks_service_endpoint["port"], "admin_token" => keystone["admin_token"] ) diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 5d2d8a8c..dd034f48 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -35,7 +35,7 @@ end mysql_info = get_settings_by_role("mysql-master", "mysql") rabbit_info = get_settings_by_role("rabbitmq-server", "rabbitmq") -nova_setup_info = get_settings_by_recipe("nova\:\:nova-setup", "nova") +nova_setup_info = get_settings_by_recipe("nova\\:\\:nova-setup", "nova") keystone = get_settings_by_role("keystone", "keystone") # find the node attribute endpoint settings for the server holding a given role diff --git a/recipes/scheduler.rb b/recipes/scheduler.rb index 78420c17..3f4e9e7d 100644 --- a/recipes/scheduler.rb +++ b/recipes/scheduler.rb @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,18 +19,7 @@ include_recipe "nova::nova-common" -# Distribution specific settings go here -if platform?(%w{fedora}) - # Fedora - nova_scheduler_package = "openstack-nova" - nova_scheduler_service = "openstack-nova-scheduler" - nova_scheduler_package_options = "" -else - # All Others (right now Debian and Ubuntu) - nova_scheduler_package = "nova-scheduler" - nova_scheduler_service = nova_scheduler_package - nova_scheduler_package_options = "-o Dpkg::Options::='--force-confold' --force-yes" -end +platform_options = node["nova"]["platform"] directory "/var/lock/nova" do owner "nova" @@ -39,12 +28,15 @@ directory "/var/lock/nova" do action :create end -package nova_scheduler_package do - action :upgrade - options nova_scheduler_package_options +platform_options["nova_scheduler_packages"].each do |pkg| + package pkg do + action :upgrade + options platform_options["nova_scheduler_service"] + end end -service nova_scheduler_service do +service "nova-scheduler" do + service_name platform_options["nova_scheduler_service"] supports :status => true, :restart => true action :enable subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed diff --git a/recipes/vncproxy.rb b/recipes/vncproxy.rb index c1cad9d5..e9577c2f 100644 --- a/recipes/vncproxy.rb +++ b/recipes/vncproxy.rb @@ -19,35 +19,22 @@ include_recipe "nova::nova-common" -# Distribution specific settings go here -if platform?(%w{fedora}) - # Fedora - # TODO(breu): fedora doesn't have a working vncproxy yet. Once they fix it include it here - # TODO(breu): fedora packages consoleauth but they don't include systemd startup scripts - nova_vncproxy_package = "openstack-nova" - nova_vncproxy_service = "openstack-nova-vncproxy" - nova_vncproxy_consoleauth_package = "openstack-nova" - #nova_vncproxy_consoleauth_service = "" - #nova_vncproxy_package_options = "" -else - # All Others (right now Debian and Ubuntu) - nova_vncproxy_package = "nova-vncproxy" - nova_vncproxy_service = nova_vncproxy_package - nova_vncproxy_consoleauth_package = "nova-consoleauth" - nova_vncproxy_consoleauth_service = nova_vncproxy_consoleauth_package - nova_vncproxy_package_options = "-o Dpkg::Options::='--force-confold' --force-yes" -end +platform_options = node["nova"]["platform"] case node["platform"] when "ubuntu","debian" - package nova_vncproxy_package do - action :upgrade - options nova_vncproxy_package_options + platform_options["nova_vncproxy_packages"].each do |pkg| + package pkg do + action :upgrade + options platform_options["nova_vncproxy_service"] + end end # required for vnc console authentication - package nova_vncproxy_consoleauth_package do - action :upgrade + platform_options["nova_vncproxy_consoleauth_packages"].each do |pkg| + package pkg do + action :upgrade + end end execute "Fix permission Bug" do @@ -56,15 +43,17 @@ when "ubuntu","debian" only_if { File.readlines("/etc/init/nova-vncproxy.conf").grep(/exec.*nova$/).size > 0 } end - service nova_vncproxy_service do + service "nova-vncproxy" do # TODO(breu): remove the platform specifier when fedora fixes their vncproxy package + service_name platform_options["nova_vncproxy_service"] supports :status => true, :restart => true action :enable subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed end - service nova_vncproxy_consoleauth_service do + service "nova-consoleauth" do # TODO(breu): remove the platform specifier when fedora fixes their vncproxy package + service_name platform_options["nova_vncproxy_consoleauth_service"] supports :status => true, :restart => true action :enable subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed