Parameterizes the hard-coded Chef role names for Keystone and nova-setup
There is a lookup-by-role mechanism in use for finding node attribute information for the node that runs the Keystone Service API as well as the node that initially executes the Nova setup code -- like creating the Nova database, etc. These role names are currently hard-coded in the recipes. This patch makes that a configurable node attribute for deployments that name their Chef roles differently.
This commit is contained in:
parent
dc1910ff82
commit
3868fcaf8b
|
@ -108,7 +108,9 @@ nova-scheduler-patch
|
|||
Attributes
|
||||
==========
|
||||
|
||||
* `nova["patch_files_on_disk"] - Boolean for patching files on disk
|
||||
* `nova["keystone_service_chef_role"]` - The name of the Chef role that sets up the Keystone Service API
|
||||
* `nova["nova_setup_chef_role"]` - The name of the Chef role that sets up Nova
|
||||
* `nova["patch_files_on_disk"]` - Boolean for patching files on disk
|
||||
* `nova["db"]["name"]` - Name of nova database
|
||||
* `nova["db"]["username"]` - Username for nova database access
|
||||
* `nova["db"]["password"]` - Password for nova database access
|
||||
|
|
|
@ -4,6 +4,12 @@ default["enable_monit"] = false # OS provides packages
|
|||
default["developer_mode"] = false # we want secure passwords by default
|
||||
########################################################################
|
||||
|
||||
# The name of the Chef role that sets up basic Nova stuff
|
||||
default["nova"]["nova_setup_chef_role"] = "nova-setup"
|
||||
|
||||
# The name of the Chef role that sets up the Keystone Service API
|
||||
default["nova"]["keystone_service_chef_role"] = "keystone"
|
||||
|
||||
default["nova"]["db"]["name"] = "nova"
|
||||
default["nova"]["db"]["username"] = "nova"
|
||||
|
||||
|
|
|
@ -52,7 +52,8 @@ end
|
|||
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||
keystone = get_settings_by_role("keystone","keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
|
||||
ec2_admin_endpoint = get_bind_endpoint("nova", "ec2-admin")
|
||||
ec2_public_endpoint = get_bind_endpoint("nova", "ec2-public")
|
||||
|
|
|
@ -48,7 +48,8 @@ end
|
|||
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||
keystone = get_settings_by_role("keystone","keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
|
||||
template "/etc/nova/api-paste.ini" do
|
||||
source "api-paste.ini.erb"
|
||||
|
|
|
@ -51,7 +51,8 @@ service "nova-api-os-compute" do
|
|||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||
end
|
||||
|
||||
keystone = get_settings_by_role("keystone", "keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||
nova_api_endpoint = get_access_endpoint("nova-api-os-compute", "nova", "api")
|
||||
|
|
|
@ -48,7 +48,8 @@ end
|
|||
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||
keystone = get_settings_by_role("keystone","keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
|
||||
template "/etc/nova/api-paste.ini" do
|
||||
source "api-paste.ini.erb"
|
||||
|
|
|
@ -42,9 +42,10 @@ end
|
|||
mysql_info = get_access_endpoint("mysql-master", "mysql", "db")
|
||||
rabbit_info = get_access_endpoint("rabbitmq-server", "rabbitmq", "queue")
|
||||
|
||||
# nova::nova-setup does not need to be double escaped here
|
||||
nova_setup_info = get_settings_by_role("nova-setup", "nova")
|
||||
keystone = get_settings_by_role("keystone", "keystone")
|
||||
nova_setup_role = node["nova"]["nova_setup_chef_role"]
|
||||
nova_setup_info = get_settings_by_role(nova_setup_role, "nova")
|
||||
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
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
|
|
|
@ -31,7 +31,8 @@ include_recipe "mysql::client"
|
|||
include_recipe "mysql::ruby"
|
||||
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone","service-api")
|
||||
keystone = get_settings_by_role("keystone", "keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
keystone_admin_user = keystone["admin_user"]
|
||||
keystone_admin_password = keystone["users"][keystone_admin_user]["password"]
|
||||
keystone_admin_tenant = keystone["users"][keystone_admin_user]["default_tenant"]
|
||||
|
|
|
@ -52,7 +52,8 @@ end
|
|||
|
||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||
keystone = get_settings_by_role("keystone","keystone")
|
||||
keystone_service_role = node["nova"]["keystone_service_chef_role"]
|
||||
keystone = get_settings_by_role(keystone_service_role, "keystone")
|
||||
volume_endpoint = get_access_endpoint("nova-volume", "nova", "volume")
|
||||
|
||||
# Register Volume Service
|
||||
|
|
Loading…
Reference in New Issue