diff --git a/manifests/api.pp b/manifests/api.pp index a5745ad6..7524e103 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -162,6 +162,9 @@ # (optional) Base directory that the Image Cache uses. # Defaults to '/var/lib/glance/image-cache'. # +# [*os_region_name*] +# (optional) Sets the keystone region to use. +# Defaults to 'RegionOne'. class glance::api( $keystone_password, $verbose = false, @@ -198,6 +201,7 @@ $database_connection = 'sqlite:///var/lib/glance/glance.sqlite', $database_idle_timeout = 3600, $image_cache_dir = '/var/lib/glance/image-cache', + $os_region_name = 'RegionOne', # DEPRECATED PARAMETERS $mysql_module = undef, $sql_idle_timeout = false, @@ -276,6 +280,7 @@ 'DEFAULT/workers': value => $workers; 'DEFAULT/show_image_direct_url': value => $show_image_direct_url; 'DEFAULT/image_cache_dir': value => $image_cache_dir; + 'DEFAULT/os_region_name': value => $os_region_name; } # known_stores config @@ -290,8 +295,9 @@ } glance_cache_config { - 'DEFAULT/verbose': value => $verbose; - 'DEFAULT/debug': value => $debug; + 'DEFAULT/verbose': value => $verbose; + 'DEFAULT/debug': value => $debug; + 'DEFAULT/os_region_name': value => $os_region_name; } # configure api service to connect registry service diff --git a/manifests/backend/cinder.pp b/manifests/backend/cinder.pp index db959333..adb68009 100644 --- a/manifests/backend/cinder.pp +++ b/manifests/backend/cinder.pp @@ -33,9 +33,9 @@ # Defaults to 'undef' # # [*os_region_name*] -# (optional) Region name of this node. -# Should be a valid region name -# Defaults to 'RegionOne' +# (optional) The os_region_name parameter is deprecated and has no effect. +# Use glance::api::os_region_name instead. +# Defaults to 'undef' # # [*cinder_ca_certificates_file*] # (optional) Location of ca certicate file to use for cinder client requests. @@ -54,7 +54,7 @@ # class glance::backend::cinder( - $os_region_name = 'RegionOne', + $os_region_name = undef, $cinder_ca_certificates_file = undef, $cinder_api_insecure = false, $cinder_catalog_info = 'volume:cinder:publicURL', @@ -63,19 +63,21 @@ ) { + if $os_region_name { + notice('The os_region_name parameter is deprecated and has no effect. Use glance::api::os_region_name instead.') + } + glance_api_config { 'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure; 'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info; 'DEFAULT/cinder_http_retries': value => $cinder_http_retries; 'DEFAULT/default_store': value => 'cinder'; - 'DEFAULT/os_region_name': value => $os_region_name; } glance_cache_config { 'DEFAULT/cinder_api_insecure': value => $cinder_api_insecure; 'DEFAULT/cinder_catalog_info': value => $cinder_catalog_info; 'DEFAULT/cinder_http_retries': value => $cinder_http_retries; - 'DEFAULT/os_region_name': value => $os_region_name; } if $cinder_endpoint_template { diff --git a/spec/classes/glance_api_spec.rb b/spec/classes/glance_api_spec.rb index 806700de..f0c77361 100644 --- a/spec/classes/glance_api_spec.rb +++ b/spec/classes/glance_api_spec.rb @@ -38,6 +38,7 @@ :purge_config => false, :known_stores => false, :image_cache_dir => '/var/lib/glance/image-cache', + :os_region_name => 'RegionOne', } end @@ -64,7 +65,8 @@ :database_idle_timeout => '36002', :database_connection => 'mysql:///var:lib@glance/glance', :show_image_direct_url => true, - :image_cache_dir => '/tmp/glance' + :image_cache_dir => '/tmp/glance', + :os_region_name => 'RegionOne2', } ].each do |param_set| @@ -96,7 +98,8 @@ 'registry_host', 'registry_port', 'registry_client_protocol', - 'show_image_direct_url' + 'show_image_direct_url', + 'os_region_name', ].each do |config| should contain_glance_api_config("DEFAULT/#{config}").with_value(param_hash[config.intern]) end @@ -107,7 +110,8 @@ 'verbose', 'debug', 'registry_host', - 'registry_port' + 'registry_port', + 'os_region_name', ].each do |config| should contain_glance_cache_config("DEFAULT/#{config}").with_value(param_hash[config.intern]) end diff --git a/spec/classes/glance_backend_cinder_spec.rb b/spec/classes/glance_backend_cinder_spec.rb index f3f33ac6..55c82d52 100644 --- a/spec/classes/glance_backend_cinder_spec.rb +++ b/spec/classes/glance_backend_cinder_spec.rb @@ -34,7 +34,6 @@ should contain_glance_api_config('DEFAULT/default_store').with_value('cinder') should contain_glance_api_config('DEFAULT/cinder_api_insecure').with_value(false) should contain_glance_api_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:publicURL') - should contain_glance_api_config('DEFAULT/os_region_name').with_value('RegionOne') should contain_glance_api_config('DEFAULT/cinder_http_retries').with_value('3') should contain_glance_api_config('DEFAULT/cinder_ca_certificates_file').with(:ensure => 'absent') should contain_glance_api_config('DEFAULT/cinder_endpoint_template').with(:ensure => 'absent') @@ -42,7 +41,6 @@ it 'configures glance-cache.conf' do should contain_glance_cache_config('DEFAULT/cinder_api_insecure').with_value(false) should contain_glance_cache_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:publicURL') - should contain_glance_cache_config('DEFAULT/os_region_name').with_value('RegionOne') should contain_glance_cache_config('DEFAULT/cinder_http_retries').with_value('3') should contain_glance_cache_config('DEFAULT/cinder_ca_certificates_file').with(:ensure => 'absent') should contain_glance_cache_config('DEFAULT/cinder_endpoint_template').with(:ensure => 'absent') @@ -57,7 +55,6 @@ :cinder_catalog_info => 'volume:cinder:internalURL', :cinder_endpoint_template => 'http://srv-foo:8776/v1/%(project_id)s', :cinder_http_retries => '10', - :os_region_name => 'foo' } end it 'configures glance-api.conf' do @@ -67,7 +64,6 @@ should contain_glance_api_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:internalURL') should contain_glance_api_config('DEFAULT/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s') should contain_glance_api_config('DEFAULT/cinder_http_retries').with_value('10') - should contain_glance_api_config('DEFAULT/os_region_name').with_value('foo') end it 'configures glance-cache.conf' do should contain_glance_cache_config('DEFAULT/cinder_api_insecure').with_value(true) @@ -75,7 +71,6 @@ should contain_glance_cache_config('DEFAULT/cinder_catalog_info').with_value('volume:cinder:internalURL') should contain_glance_cache_config('DEFAULT/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s') should contain_glance_cache_config('DEFAULT/cinder_http_retries').with_value('10') - should contain_glance_cache_config('DEFAULT/os_region_name').with_value('foo') end end