Add the capability to configure api-paste.ini with config.pp

Already added type/provider for paste configs,
but it wouldn't to patch sahara::config.

Change-Id: Iba618f27b110192c1751486681d77c1c9d46c541
This commit is contained in:
ZhongShengping 2016-02-19 02:29:17 +08:00
parent 90737ac521
commit 00dac9470a
2 changed files with 17 additions and 0 deletions

View File

@ -17,14 +17,20 @@
# DEFAULT/bar:
# value: barValue
#
# [*sahara_api_paste_ini*]
# (optional) Allow configuration of /etc/sahara/api-paste.ini options.
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
class sahara::config (
$sahara_config = {},
$sahara_api_paste_ini = {},
) {
validate_hash($sahara_config)
validate_hash($sahara_api_paste_ini)
create_resources('sahara_config', $sahara_config)
create_resources('sahara_api_paste_ini', $sahara_api_paste_ini)
}

View File

@ -7,6 +7,11 @@ describe 'sahara::config' do
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
},
:sahara_api_paste_ini => {
'DEFAULT/foo2' => { 'value' => 'fooValue' },
'DEFAULT/bar2' => { 'value' => 'barValue' },
'DEFAULT/baz2' => { 'ensure' => 'absent' }
}
}
end
@ -17,4 +22,10 @@ describe 'sahara::config' do
is_expected.to contain_sahara_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary sahara-api-paste configurations' do
is_expected.to contain_sahara_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
is_expected.to contain_sahara_api_paste_ini('DEFAULT/bar2').with_value('barValue')
is_expected.to contain_sahara_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
end
end