Introduce designate:config to manage custom options
This designate::config is aim to use designate config resources to manage custom configurations in designate config files. This will make end user easy to add their own custom options in Hiera data. Fully implements blueprint designate-custom-config Change-Id: I11a4cd53ae68113341e8b0851c68c9d09c362e86
This commit is contained in:
parent
439f9f0870
commit
c444ca0989
|
@ -0,0 +1,39 @@
|
|||
# == Class: designate::config
|
||||
#
|
||||
# This class is used to manage arbitrary designate configurations.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*xxx_config*]
|
||||
# (optional) Allow configuration of arbitrary designate configurations.
|
||||
# The value is an hash of xxx_config resources. Example:
|
||||
# { 'DEFAULT/foo' => { value => 'fooValue'},
|
||||
# 'DEFAULT/bar' => { value => 'barValue'}
|
||||
# }
|
||||
#
|
||||
# In yaml format, Example:
|
||||
# xxx_config:
|
||||
# DEFAULT/foo:
|
||||
# value: fooValue
|
||||
# DEFAULT/bar:
|
||||
# value: barValue
|
||||
#
|
||||
# [**designate_config**]
|
||||
# (optional) Allow configuration of designate.conf configurations.
|
||||
#
|
||||
# [**api_paste_ini_config**]
|
||||
# (optional) Allow configuration of /etc/designate/api-paste.ini configurations.
|
||||
#
|
||||
# NOTE: The configuration MUST NOT be already handled by this module
|
||||
# or Puppet catalog compilation will fail with duplicate resources.
|
||||
#
|
||||
class designate::config (
|
||||
$designate_config = {},
|
||||
$api_paste_ini_config = {},
|
||||
) {
|
||||
validate_hash($designate_config)
|
||||
validate_hash($api_paste_ini_config)
|
||||
|
||||
create_resources('designate_config', $designate_config)
|
||||
create_resources('designate_api_paste_ini', $api_paste_ini_config)
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'designate::config' do
|
||||
|
||||
let :params do
|
||||
{ :designate_config => {
|
||||
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:api_paste_ini_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures arbitrary designate configurations' do
|
||||
should contain_designate_config('DEFAULT/foo').with_value('fooValue')
|
||||
should contain_designate_config('DEFAULT/bar').with_value('barValue')
|
||||
should contain_designate_config('DEFAULT/baz').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary designate api-paste configurations' do
|
||||
should contain_designate_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
|
||||
should contain_designate_api_paste_ini('DEFAULT/bar2').with_value('barValue')
|
||||
should contain_designate_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue