diff --git a/manifests/api.pp b/manifests/api.pp index 7b0b69fd..ae5c825c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -206,10 +206,6 @@ # Allowed values: 'qcow2', 'raw', 'vmdk', false. # Defaults to $::os_service_default (disabled) # -# [*os_region_name*] -# (optional) Sets the keystone region to use. -# Defaults to 'RegionOne'. -# # [*enable_proxy_headers_parsing*] # (Optional) Enable paste middleware to handle SSL requests through # HTTPProxyToWSGI middleware. @@ -316,6 +312,10 @@ # (optional) Minimum number of SQL connections to keep open in a pool. # Defaults to undef. # +# [*os_region_name*] +# (optional) Sets the keystone region to use. +# Defaults to undef +# class glance::api( $package_ensure = 'present', $bind_host = $::os_service_default, @@ -363,7 +363,6 @@ class glance::api( $taskflow_engine_mode = $::os_service_default, $taskflow_max_workers = $::os_service_default, $conversion_format = $::os_service_default, - $os_region_name = 'RegionOne', $enable_proxy_headers_parsing = $::os_service_default, $max_request_body_size = $::os_service_default, $enable_v1_api = false, @@ -385,12 +384,18 @@ class glance::api( $registry_client_protocol = undef, $show_multiple_locations = undef, $database_min_pool_size = undef, + $os_region_name = undef, ) inherits glance { include glance::deps include glance::policy include glance::api::db + if $os_region_name != undef { + warning('glance::api::os_region_name is deprecated. Use \ +cinder::backend::multistore::cinder::cinder_os_region_name instead.') + } + if $sync_db { include glance::db::sync include glance::db::metadefs @@ -432,7 +437,6 @@ class glance::api( 'DEFAULT/enable_v2_api': value => $enable_v2_api; 'DEFAULT/limit_param_default': value => $limit_param_default; 'DEFAULT/api_limit_max': value => $api_limit_max; - 'glance_store/os_region_name': value => $os_region_name; } if $show_multiple_locations { diff --git a/manifests/backend/cinder.pp b/manifests/backend/cinder.pp index 54fd2a41..cf52e799 100644 --- a/manifests/backend/cinder.pp +++ b/manifests/backend/cinder.pp @@ -63,6 +63,10 @@ # (optional) A valid password for the user specified by `cinder_store_user_name' # Defaults to $::os_service_default. # +# [*cinder_os_region_name*] +# (optional) Sets the keystone region to use. +# Defaults to 'RegionOne'. +# # [*multi_store*] # (optional) Boolean describing if multiple backends will be configured # Defaults to false @@ -77,6 +81,7 @@ class glance::backend::cinder( $cinder_store_project_name = $::os_service_default, $cinder_store_user_name = $::os_service_default, $cinder_store_password = $::os_service_default, + $cinder_os_region_name = 'RegionOne', $multi_store = false, ) { @@ -84,6 +89,9 @@ class glance::backend::cinder( warning('glance::backend::cinder is deprecated. Use glance::backend::multistore::cinder instead.') + # to keep backwards compatibility + $cinder_os_region_name_real = pick($::glance::api::os_region_name, $cinder_os_region_name) + glance::backend::multistore::cinder { 'glance_store': cinder_api_insecure => $cinder_api_insecure, cinder_catalog_info => $cinder_catalog_info, @@ -94,6 +102,7 @@ class glance::backend::cinder( cinder_store_project_name => $cinder_store_project_name, cinder_store_user_name => $cinder_store_user_name, cinder_store_password => $cinder_store_password, + cinder_os_region_name => $cinder_os_region_name_real, store_description => undef, } diff --git a/manifests/backend/multistore/cinder.pp b/manifests/backend/multistore/cinder.pp index 084e78e6..2a861dda 100644 --- a/manifests/backend/multistore/cinder.pp +++ b/manifests/backend/multistore/cinder.pp @@ -61,6 +61,10 @@ # (optional) A valid password for the user specified by `cinder_store_user_name' # Defaults to $::os_service_default. # +# [*cinder_os_region_name*] +# (optional) Sets the keystone region to use. +# Defaults to 'RegionOne'. +# # [*cinder_enforce_multipath*] # (optional) Enforce multipath usage when attaching a cinder volume # Defaults to $::os_service_default. @@ -84,6 +88,7 @@ define glance::backend::multistore::cinder( $cinder_store_project_name = $::os_service_default, $cinder_store_user_name = $::os_service_default, $cinder_store_password = $::os_service_default, + $cinder_os_region_name = 'RegionOne', $cinder_enforce_multipath = $::os_service_default, $cinder_use_multipath = $::os_service_default, $store_description = $::os_service_default, @@ -91,6 +96,9 @@ define glance::backend::multistore::cinder( include glance::deps + # to keep backwards compatibility + $cinder_os_region_name_real = pick($::glance::api::os_region_name, $cinder_os_region_name) + glance_api_config { "${name}/cinder_api_insecure": value => $cinder_api_insecure; "${name}/cinder_catalog_info": value => $cinder_catalog_info; @@ -101,6 +109,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_store_project_name": value => $cinder_store_project_name; "${name}/cinder_store_user_name": value => $cinder_store_user_name; "${name}/cinder_store_password": value => $cinder_store_password; + "${name}/cinder_os_region_name": value => $cinder_os_region_name_real; "${name}/cinder_enforce_multipath": value => $cinder_enforce_multipath; "${name}/cinder_use_multipath": value => $cinder_use_multipath; "${name}/store_description": value => $store_description; @@ -115,6 +124,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_store_auth_address": value => $cinder_store_auth_address; "${name}/cinder_store_project_name": value => $cinder_store_project_name; "${name}/cinder_store_user_name": value => $cinder_store_user_name; + "${name}/cinder_os_region_name": value => $cinder_os_region_name_real; "${name}/cinder_enforce_multipath": value => $cinder_enforce_multipath; "${name}/cinder_use_multipath": value => $cinder_use_multipath; "${name}/cinder_store_password": value => $cinder_store_password; diff --git a/manifests/registry.pp b/manifests/registry.pp index 56300d25..4821bb9b 100644 --- a/manifests/registry.pp +++ b/manifests/registry.pp @@ -80,10 +80,6 @@ # (optional) CA certificate file to use to verify connecting clients # Defaults to $::os_service_default. # -# [*os_region_name*] -# (optional) Sets the keystone region to use. -# Defaults to $::os_service_default. -# # [*enable_v1_registry*] # (optional) Deploy the v1 API Registry service. # If glance::api::enable_v1_api is set to True, this option also needs to be @@ -98,6 +94,10 @@ # (optional) Minimum number of SQL connections to keep open in a pool. # Defaults to undef. # +# [*os_region_name*] +# (optional) Sets the keystone region to use. +# Defaults to undef. +# class glance::registry( $package_ensure = 'present', $bind_host = $::os_service_default, @@ -117,10 +117,10 @@ class glance::registry( $cert_file = $::os_service_default, $key_file = $::os_service_default, $ca_file = $::os_service_default, - $os_region_name = $::os_service_default, $enable_v1_registry = false, # DEPRECATED PARAMETERS $database_min_pool_size = undef, + $os_region_name = undef, ) inherits glance { warning('glance::registry is deprecated, and will be removed in a future release') @@ -128,6 +128,11 @@ class glance::registry( include glance::deps include glance::registry::db + if $os_region_name != undef { + warning('glance::registry::os_region_name is deprecated. Use \ +cinder::backend::multistore::cinder::cinder_os_region_name instead.') + } + if ( $glance::params::api_package_name != $glance::params::registry_package_name ) { ensure_packages($glance::params::registry_package_name, { diff --git a/releasenotes/notes/cinder_os_region_name-60667efbd630f04f.yaml b/releasenotes/notes/cinder_os_region_name-60667efbd630f04f.yaml new file mode 100644 index 00000000..6e695689 --- /dev/null +++ b/releasenotes/notes/cinder_os_region_name-60667efbd630f04f.yaml @@ -0,0 +1,10 @@ +--- +features: + - | + The new parameter, ``cinder_os_region_name`` was added to + ``glance::backend::cinder`` and ``glance::backend::multistore::cinder``, + to configure keystone region used for connection to cinder. +deprecations: + - | + ``glance::api::os_region_name`` and ``glance::registry::os_region_name`` + were deperecated. Use new cinder_os_region_name pamraeters instead. diff --git a/spec/classes/glance_api_spec.rb b/spec/classes/glance_api_spec.rb index 5529fafa..ef90a9ba 100644 --- a/spec/classes/glance_api_spec.rb +++ b/spec/classes/glance_api_spec.rb @@ -33,7 +33,6 @@ describe 'glance::api' do :image_member_quota => '', :image_cache_stall_time => '', :image_cache_max_size => '', - :os_region_name => 'RegionOne', :pipeline => 'keystone', :task_time_to_live => '', :task_executor => '', @@ -78,7 +77,6 @@ describe 'glance::api' do :image_member_quota => '128', :image_cache_stall_time => '10', :image_cache_max_size => '10737418240', - :os_region_name => 'RegionOne2', :pipeline => 'keystone2', :sync_db => false, :limit_param_default => '10', @@ -175,15 +173,6 @@ describe 'glance::api' do end end - it 'is_expected.to lay down default glance_store api and cache config' do - [ - 'os_region_name', - ].each do |config| - is_expected.to contain_glance_cache_config("glance_store/#{config}").with_value(param_hash[config.intern]) - is_expected.to contain_glance_api_config("glance_store/#{config}").with_value(param_hash[config.intern]) - end - end - it 'is_expected.to lay down default glance_store api config' do [ 'filesystem_store_metadata_file', diff --git a/spec/classes/glance_backend_cinder_spec.rb b/spec/classes/glance_backend_cinder_spec.rb index a8250d53..002c0866 100644 --- a/spec/classes/glance_backend_cinder_spec.rb +++ b/spec/classes/glance_backend_cinder_spec.rb @@ -41,6 +41,7 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_api_config('glance_store/cinder_store_auth_address').with_value('') is_expected.to contain_glance_api_config('glance_store/cinder_store_project_name').with_value('') is_expected.to contain_glance_api_config('glance_store/cinder_store_user_name').with_value('') + is_expected.to contain_glance_api_config('glance_store/cinder_os_region_name').with_value('RegionOne') is_expected.to contain_glance_api_config('glance_store/cinder_store_password').with_value('') end it 'configures glance-cache.conf' do @@ -52,6 +53,7 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_cache_config('glance_store/cinder_store_auth_address').with_value('') is_expected.to contain_glance_cache_config('glance_store/cinder_store_project_name').with_value('') is_expected.to contain_glance_cache_config('glance_store/cinder_store_user_name').with_value('') + is_expected.to contain_glance_cache_config('glance_store/cinder_os_region_name').with_value('RegionOne') is_expected.to contain_glance_cache_config('glance_store/cinder_store_password').with_value('') end end @@ -68,6 +70,7 @@ describe 'glance::backend::cinder' do :cinder_store_project_name => 'services', :cinder_store_user_name => 'glance', :cinder_store_password => 'glance', + :cinder_os_region_name => 'RegionTwo', } end it 'configures glance-api.conf' do @@ -80,6 +83,7 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_api_config('glance_store/cinder_store_project_name').with_value('services') is_expected.to contain_glance_api_config('glance_store/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_api_config('glance_store/cinder_store_password').with_value('glance') + is_expected.to contain_glance_api_config('glance_store/cinder_os_region_name').with_value('RegionTwo') end it 'configures glance-cache.conf' do is_expected.to contain_glance_cache_config('glance_store/cinder_api_insecure').with_value(true) @@ -91,6 +95,7 @@ describe 'glance::backend::cinder' do is_expected.to contain_glance_cache_config('glance_store/cinder_store_project_name').with_value('services') is_expected.to contain_glance_cache_config('glance_store/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_cache_config('glance_store/cinder_store_password').with_value('glance') + is_expected.to contain_glance_cache_config('glance_store/cinder_os_region_name').with_value('RegionTwo') end end end diff --git a/spec/classes/glance_registry_spec.rb b/spec/classes/glance_registry_spec.rb index 3e4aeb21..bc5aa4e6 100644 --- a/spec/classes/glance_registry_spec.rb +++ b/spec/classes/glance_registry_spec.rb @@ -15,7 +15,6 @@ describe 'glance::registry' do :enabled => true, :manage_service => true, :purge_config => false, - :os_region_name => '', :ca_file => '', :cert_file => '', :key_file => '', @@ -30,7 +29,6 @@ describe 'glance::registry' do :bind_port => '9111', :workers => '5', :enabled => false, - :os_region_name => 'RegionOne2', } ].each do |param_set| @@ -74,13 +72,6 @@ describe 'glance::registry' do is_expected.to contain_glance_registry_config("paste_deploy/flavor").with_value('keystone') end end - it 'is_expected.to lay down default glance_store registry config' do - [ - 'os_region_name', - ].each do |config| - is_expected.to contain_glance_registry_config("glance_store/#{config}").with_value(param_hash[config.intern]) - end - end it 'is_expected.to lay down default ssl config' do [ 'ca_file', diff --git a/spec/defines/glance_backend_multistore_cinder_spec.rb b/spec/defines/glance_backend_multistore_cinder_spec.rb index 3625aa05..e8fc7ac6 100644 --- a/spec/defines/glance_backend_multistore_cinder_spec.rb +++ b/spec/defines/glance_backend_multistore_cinder_spec.rb @@ -40,6 +40,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_store_project_name').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_store_user_name').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_store_password').with_value('') + is_expected.to contain_glance_api_config('cinder/cinder_os_region_name').with_value('RegionOne') is_expected.to contain_glance_api_config('cinder/cinder_enforce_multipath').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_use_multipath').with_value('') end @@ -54,6 +55,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_store_project_name').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_store_user_name').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_store_password').with_value('') + is_expected.to contain_glance_cache_config('cinder/cinder_os_region_name').with_value('RegionOne') is_expected.to contain_glance_cache_config('cinder/cinder_enforce_multipath').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_use_multipath').with_value('') end @@ -72,6 +74,7 @@ describe 'glance::backend::multistore::cinder' do :cinder_store_project_name => 'services', :cinder_store_user_name => 'glance', :cinder_store_password => 'glance', + :cinder_os_region_name => 'RegionTwo', :cinder_enforce_multipath => true, :cinder_use_multipath => true, } @@ -87,6 +90,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_store_project_name').with_value('services') is_expected.to contain_glance_api_config('cinder/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_api_config('cinder/cinder_store_password').with_value('glance') + is_expected.to contain_glance_api_config('cinder/cinder_os_region_name').with_value('RegionTwo') is_expected.to contain_glance_api_config('cinder/cinder_enforce_multipath').with_value(true) is_expected.to contain_glance_api_config('cinder/cinder_use_multipath').with_value(true) end @@ -101,6 +105,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_store_project_name').with_value('services') is_expected.to contain_glance_cache_config('cinder/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_cache_config('cinder/cinder_store_password').with_value('glance') + is_expected.to contain_glance_cache_config('cinder/cinder_os_region_name').with_value('RegionTwo') is_expected.to contain_glance_cache_config('cinder/cinder_enforce_multipath').with_value(true) is_expected.to contain_glance_cache_config('cinder/cinder_use_multipath').with_value(true) end