Add api_paste type/provider for Heat

Add the capability to configure api-paste.ini with config.pp.
Closes-bug: #1483371

Change-Id: Ide505a7cc0ed2e5a64db0fca0a6ae0c1ba7a3a7e
This commit is contained in:
ZhongShengping 2016-02-17 12:08:49 +08:00
parent 811f7ce4b0
commit df8fe7fde4
2 changed files with 18 additions and 1 deletions

View File

@ -17,16 +17,22 @@
# DEFAULT/bar:
# value: barValue
#
# [*heat_api_paste_ini*]
# (optional) Allow configuration of /etc/heat/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 heat::config (
$heat_config = {},
$heat_config = {},
$heat_api_paste_ini = {},
) {
include ::heat::deps
validate_hash($heat_config)
validate_hash($heat_api_paste_ini)
create_resources('heat_config', $heat_config)
create_resources('heat_api_paste_ini', $heat_api_paste_ini)
}

View File

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