Add swift_proxy_config in swift::config

This patch aims to add the ability of configuring arbitrary options
in swift-proxy.conf via swift::config.

Change-Id: Id565326e8cf6368d061b1e3315b6e2ecbde3b059
This commit is contained in:
Xingchao Yu
2017-08-21 15:37:43 +08:00
parent 8aeab42257
commit 8fd6577110
2 changed files with 18 additions and 1 deletions

View File

@@ -24,15 +24,22 @@
# (optional) Allow configuration for specifying the allowable # (optional) Allow configuration for specifying the allowable
# clusters and their information. # clusters and their information.
# #
# [*swift_proxy_config*]
# (optional) Allow configuration of arbitrary Swift Proxy configurations.
# The value is an hash of swift_proxy_config resources.
#
class swift::config ( class swift::config (
$swift_config = {}, $swift_config = {},
$swift_container_sync_realms_config = {} $swift_container_sync_realms_config = {},
$swift_proxy_config = {},
) { ) {
include ::swift::deps include ::swift::deps
validate_hash($swift_config) validate_hash($swift_config)
validate_hash($swift_container_sync_realms_config) validate_hash($swift_container_sync_realms_config)
validate_hash($swift_proxy_config)
create_resources('swift_config', $swift_config) create_resources('swift_config', $swift_config)
create_resources('swift_container_sync_realms_config', $swift_container_sync_realms_config) create_resources('swift_container_sync_realms_config', $swift_container_sync_realms_config)
create_resources('swift_proxy_config', $swift_proxy_config)
} }

View File

@@ -7,6 +7,11 @@ describe 'swift::config' do
'DEFAULT/foo' => { 'value' => 'fooValue' }, 'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' }, 'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' } 'DEFAULT/baz' => { 'ensure' => 'absent' }
},
:swift_proxy_config => {
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
} }
} }
end end
@@ -16,5 +21,10 @@ describe 'swift::config' do
is_expected.to contain_swift_config('DEFAULT/bar').with_value('barValue') is_expected.to contain_swift_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_swift_config('DEFAULT/baz').with_ensure('absent') is_expected.to contain_swift_config('DEFAULT/baz').with_ensure('absent')
end end
it 'configures arbitrary swift proxy configurations' do
is_expected.to contain_swift_proxy_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_swift_proxy_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_swift_proxy_config('DEFAULT/baz').with_ensure('absent')
end
end end