diff --git a/manifests/backend/swift.pp b/manifests/backend/swift.pp index 6065acff..ea3a34b5 100644 --- a/manifests/backend/swift.pp +++ b/manifests/backend/swift.pp @@ -29,6 +29,9 @@ # [*swift_store_endpoint_type*] # Optional. Default: 'internalURL' # +# [*swift_store_region*] +# Optional. Default: undef +# class glance::backend::swift( $swift_store_user, $swift_store_key, @@ -37,7 +40,8 @@ class glance::backend::swift( $swift_store_auth_version = '2', $swift_store_large_object_size = '5120', $swift_store_create_container_on_put = false, - $swift_store_endpoint_type = 'internalURL' + $swift_store_endpoint_type = 'internalURL', + $swift_store_region = undef, ) { glance_api_config { @@ -45,6 +49,7 @@ class glance::backend::swift( 'glance_store/swift_store_user': value => $swift_store_user; 'glance_store/swift_store_key': value => $swift_store_key; 'glance_store/swift_store_auth_address': value => $swift_store_auth_address; + 'glance_store/swift_store_region': value => $swift_store_region; 'glance_store/swift_store_container': value => $swift_store_container; 'glance_store/swift_store_auth_version': value => $swift_store_auth_version; 'glance_store/swift_store_create_container_on_put': @@ -59,6 +64,7 @@ class glance::backend::swift( 'glance_store/swift_store_user': value => $swift_store_user; 'glance_store/swift_store_key': value => $swift_store_key; 'glance_store/swift_store_auth_address': value => $swift_store_auth_address; + 'glance_store/swift_store_region': value => $swift_store_region; 'glance_store/swift_store_container': value => $swift_store_container; 'glance_store/swift_store_auth_version': value => $swift_store_auth_version; 'glance_store/swift_store_create_container_on_put': diff --git a/spec/classes/glance_backend_swift_spec.rb b/spec/classes/glance_backend_swift_spec.rb index 65d09ddd..0993b5a4 100644 --- a/spec/classes/glance_backend_swift_spec.rb +++ b/spec/classes/glance_backend_swift_spec.rb @@ -30,6 +30,7 @@ describe 'glance::backend::swift' do is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('glance') is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(false) is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL') + is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value(nil) end it 'configures glance-cache.conf' do @@ -40,6 +41,7 @@ describe 'glance::backend::swift' do is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/') is_expected.to contain_glance_cache_config('glance_store/swift_store_container').with_value('glance') is_expected.to contain_glance_cache_config('glance_store/swift_store_create_container_on_put').with_value(false) + is_expected.to contain_glance_cache_config('glance_store/swift_store_region').with_value(nil) end end @@ -53,7 +55,8 @@ describe 'glance::backend::swift' do :swift_store_auth_address => '127.0.0.2:8080/v1.0/', :swift_store_container => 'swift', :swift_store_create_container_on_put => true, - :swift_store_endpoint_type => 'publicURL' + :swift_store_endpoint_type => 'publicURL', + :swift_store_region => 'RegionTwo' } end @@ -64,6 +67,7 @@ describe 'glance::backend::swift' do is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('100') is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/') is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('publicURL') + is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('RegionTwo') end it 'configures glance-cache.conf' do @@ -72,6 +76,7 @@ describe 'glance::backend::swift' do is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_version').with_value('1') is_expected.to contain_glance_cache_config('glance_store/swift_store_large_object_size').with_value('100') is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/') + is_expected.to contain_glance_cache_config('glance_store/swift_store_region').with_value('RegionTwo') end end end