From df8fe7fde475de1476c847dbbba5a168a0d4c0cb Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Wed, 17 Feb 2016 12:08:49 +0800 Subject: [PATCH] Add api_paste type/provider for Heat Add the capability to configure api-paste.ini with config.pp. Closes-bug: #1483371 Change-Id: Ide505a7cc0ed2e5a64db0fca0a6ae0c1ba7a3a7e --- manifests/config.pp | 8 +++++++- spec/classes/heat_config_spec.rb | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 79bb6cba..ad355e9d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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) } diff --git a/spec/classes/heat_config_spec.rb b/spec/classes/heat_config_spec.rb index 9a1bf273..aff161d1 100644 --- a/spec/classes/heat_config_spec.rb +++ b/spec/classes/heat_config_spec.rb @@ -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