diff --git a/recipes/api-ec2.rb b/recipes/api-ec2.rb index 3f77cc4f..c43e95a2 100644 --- a/recipes/api-ec2.rb +++ b/recipes/api-ec2.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + ::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) include_recipe "nova::nova-common" @@ -50,13 +54,13 @@ service "nova-api-ec2" do subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed end -identity_admin_endpoint = ::Openstack::endpoint('identity-admin') -identity_endpoint = ::Openstack::endpoint('identity-api') +identity_admin_endpoint = endpoint('identity-admin') +identity_endpoint = endpoint('identity-api') keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") -ec2_admin_endpoint = ::Openstack::endpoint('compute-ec2-admin') -ec2_public_endpoint = ::Openstack::endpoint('compute-ec2-api') +ec2_admin_endpoint = endpoint('compute-ec2-admin') +ec2_public_endpoint = endpoint('compute-ec2-api') # Register Service Tenant keystone_register "Register Service Tenant" do diff --git a/recipes/api-metadata.rb b/recipes/api-metadata.rb index 6a5efb25..77559152 100644 --- a/recipes/api-metadata.rb +++ b/recipes/api-metadata.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + include_recipe "nova::nova-common" platform_options = node["nova"]["platform"] @@ -46,8 +50,8 @@ service "nova-api-metadata" do subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed end -identity_admin_endpoint = ::Openstack::endpoint('identity-admin') -identity_endpoint = ::Openstack::endpoint('identity-api') +identity_admin_endpoint = endpoint('identity-admin') +identity_endpoint = endpoint('identity-api') keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") diff --git a/recipes/api-os-compute.rb b/recipes/api-os-compute.rb index b7702641..53d16ccc 100644 --- a/recipes/api-os-compute.rb +++ b/recipes/api-os-compute.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + ::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) include_recipe "nova::nova-common" @@ -53,9 +57,9 @@ end keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") -identity_admin_endpoint = ::Openstack::endpoint('identity-admin') -identity_endpoint = ::Openstack::endpoint('identity-api') -nova_api_endpoint = ::Openstack::endpoint('compute-api') +identity_admin_endpoint = endpoint('identity-admin') +identity_endpoint = endpoint('identity-api') +nova_api_endpoint = endpoint('compute-api') # Register Service Tenant keystone_register "Register Service Tenant" do diff --git a/recipes/api-os-volume.rb b/recipes/api-os-volume.rb index be4af73b..a6d80f41 100644 --- a/recipes/api-os-volume.rb +++ b/recipes/api-os-volume.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + include_recipe "nova::nova-common" platform_options = node["nova"]["platform"] @@ -46,8 +50,8 @@ service "nova-api-os-volume" do subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed end -identity_admin_endpoint = ::Openstack::endpoint('identity-admin') -identity_endpoint = ::Openstack::endpoint('identity-api') +identity_admin_endpoint = endpoint('identity-admin') +identity_endpoint = endpoint('identity-api') keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") diff --git a/recipes/compute.rb b/recipes/compute.rb index 5f82db2a..c164a891 100644 --- a/recipes/compute.rb +++ b/recipes/compute.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + include_recipe "nova::nova-common" include_recipe "nova::api-metadata" include_recipe "nova::network" diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 229c5943..85a95496 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + if platform?(%w(redhat centos)) include_recipe "yum::epel" end @@ -48,19 +52,19 @@ nova_setup_info = get_settings_by_role(nova_setup_role, "nova") db_user = node['db']['username'] db_pass = nova_setup_info['db']['password'] -sql_connection = ::Openstack::db_uri("compute", db_user, db_pass) +sql_connection = db_uri("compute", db_user, db_pass) keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") # find the node attribute endpoint settings for the server holding a given role -identity_endpoint = ::Openstack::endpoint('identity-api') -xvpvnc_endpoint = ::Openstack::endpoint('compute-xvpvnc') || {} -novnc_endpoint = ::Openstack::endpoint('compute-novnc-server') || {} -novnc_proxy_endpoint = ::Openstack::endpoint('compute-novnc') -nova_api_endpoint = ::Openstack::endpoint('compute-api') || {} -ec2_public_endpoint = ::Openstack::endpoint('compute-ec2-api') || {} -image_endpoint = ::Openstack::endpoint('image-api') +identity_endpoint = endpoint('identity-api') +xvpvnc_endpoint = endpoint('compute-xvpvnc') || {} +novnc_endpoint = endpoint('compute-novnc-server') || {} +novnc_proxy_endpoint = endpoint('compute-novnc') +nova_api_endpoint = endpoint('compute-api') || {} +ec2_public_endpoint = endpoint('compute-ec2-api') || {} +image_endpoint = endpoint('image-api') Chef::Log.debug("nova::nova-common:rabbit_info|#{rabbit_info}") Chef::Log.debug("nova::nova-common:keystone|#{keystone}") diff --git a/recipes/nova-setup.rb b/recipes/nova-setup.rb index 4ac325ba..f62881de 100644 --- a/recipes/nova-setup.rb +++ b/recipes/nova-setup.rb @@ -39,7 +39,7 @@ keystone_admin_tenant = keystone["users"][keystone_admin_user]["default_tenant"] #creates db and user #function defined in osops-utils/libraries # TODO(jaypipes): Replace this with a recipe in openstack-common -# that uses the ::Openstack::db_uri() library routine to create +# that uses the db_uri() library routine to create # the database create_db_and_user("mysql", node["nova"]["db"]["name"], diff --git a/recipes/volume.rb b/recipes/volume.rb index ec799e55..11ca0300 100644 --- a/recipes/volume.rb +++ b/recipes/volume.rb @@ -17,6 +17,10 @@ # limitations under the License. # +class ::Chef::Recipe + include ::Openstack +end + include_recipe "nova::nova-common" include_recipe "nova::api-os-volume" @@ -50,11 +54,11 @@ end # stop_cmd "/usr/sbin/service #{service_name} stop" # end -identity_admin_endpoint = ::Openstack::endpoint('identity-admin') -identity_endpoint = ::Openstack::endpoint('identity-api') +identity_admin_endpoint = endpoint('identity-admin') +identity_endpoint = endpoint('identity-api') keystone_service_role = node["nova"]["keystone_service_chef_role"] keystone = get_settings_by_role(keystone_service_role, "keystone") -volume_endpoint = ::Openstack::endpoint('compute-volume') +volume_endpoint = endpoint('compute-volume') # Register Volume Service keystone_register "Register Volume Service" do