From 1f28a36e281de156ad5ccca5202412c5f9427bf3 Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Tue, 9 Oct 2012 17:43:23 -0400 Subject: [PATCH 1/2] Parameterize the Chef roles needed in setup Both the Glance API and Registry recipes were hard-coding the names of the Chef roles that the recipes -- via the osops-utils::ip_location::get_settings_by_role call -- were depending on. This patch parameterizes those hard-coded Chef role names, allowing deployers who have their roles named differently, to use these cookbooks. --- README.md | 4 +++- attributes/default.rb | 6 ++++++ recipes/api.rb | 4 ++-- recipes/registry.rb | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5882351..97aa7b9 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ registry Attributes ========== +* `glance["keystone_service_chef_role"]` - The name of the Chef role that installs the Keystone Service API +* `glance["glance_api_chef_role"]` - The name of the Chef role that installs the Glance API service * `glance["db"]["name"]` - Name of glance database * `glance["db"]["user"]` - Username for glance database access * `glance["db"]["password"]` - Password for glance database access @@ -115,7 +117,7 @@ Attributes * `glance["service_role"]` - User role used by glance when interacting with keystone - used in the API and registry paste.ini files * `glance["image_upload"]` - Toggles whether to automatically upload images in the `glance["images"]` array * `glance["images"]` - Default list of images to upload to the glance repository as part of the install -* `glance["image][""]` - URL location of the image. There can be multiple instances of this line to define multiple imagess (eg natty, maverick, fedora17 etc) +* `glance["image][""]` - URL location of the `` image. There can be multiple instances of this line to define multiple imagess (eg natty, maverick, fedora17 etc) --- example `glance["image]["natty"]` - "http://c250663.r63.cf1.rackcdn.com/ubuntu-11.04-server-uec-amd64-multinic.tar.gz" * `glance["api"]["default_store"]` - Toggles the backend storage type. Currently supported is "file" and "swift" * `glance["api"]["swift"]["store_container"] - Set the container used by glance to store images and snapshots. Defaults to "glance" diff --git a/attributes/default.rb b/attributes/default.rb index 54cf060..e4820a1 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -22,6 +22,12 @@ default["developer_mode"] = false # we want secure passwords by default ######################################################################## +# This is the name of the Chef role that will install the Keystone Service API +default["glance"]["keystone_service_chef_role"] = "keystone" + +# This is the name of the Chef role that will install the Glance API service +default["glance"]["glance_api_chef_role"] = "glance-api" + default["glance"]["services"]["api"]["scheme"] = "http" # node_attribute default["glance"]["services"]["api"]["network"] = "public" # node_attribute default["glance"]["services"]["api"]["port"] = 9292 # node_attribute diff --git a/recipes/api.rb b/recipes/api.rb index 611ae4c..ace0fc8 100644 --- a/recipes/api.rb +++ b/recipes/api.rb @@ -63,8 +63,8 @@ rabbit_info = get_settings_by_role("rabbitmq-server", "rabbitmq") # FIXME: acces 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") -glance = get_settings_by_role("glance-api", "glance") +keystone = get_settings_by_role(node["glance"]["keystone_service_chef_role", "keystone") +glance = get_settings_by_role(node["glance"]["glance_api_chef_role"], "glance") registry_endpoint = get_access_endpoint("glance-registry", "glance", "registry") api_endpoint = get_bind_endpoint("glance", "api") diff --git a/recipes/registry.rb b/recipes/registry.rb index 29038f2..487058c 100644 --- a/recipes/registry.rb +++ b/recipes/registry.rb @@ -39,7 +39,7 @@ 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 = get_settings_by_role(node["glance"]["keystone_service_chef_role"], "keystone") registry_endpoint = get_bind_endpoint("glance", "registry") From 61ff18175cbc432fbbdbb3b20df0e81d964ac158 Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Tue, 9 Oct 2012 17:49:01 -0400 Subject: [PATCH 2/2] Missing closing bracket --- recipes/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/api.rb b/recipes/api.rb index ace0fc8..135197d 100644 --- a/recipes/api.rb +++ b/recipes/api.rb @@ -63,7 +63,7 @@ rabbit_info = get_settings_by_role("rabbitmq-server", "rabbitmq") # FIXME: acces 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(node["glance"]["keystone_service_chef_role", "keystone") +keystone = get_settings_by_role(node["glance"]["keystone_service_chef_role"], "keystone") glance = get_settings_by_role(node["glance"]["glance_api_chef_role"], "glance") registry_endpoint = get_access_endpoint("glance-registry", "glance", "registry")