Add purge_config option

Add the option in order to facilitate management.
User can ensure that only the options they hoped
are configured.

Change-Id: I6b31aefe35329111323499b70bd8d94bc317c20d
This commit is contained in:
ZhongShengping 2016-06-03 23:32:02 +08:00
parent 9c186cea98
commit 6251c36787
2 changed files with 24 additions and 3 deletions

View File

@ -243,6 +243,11 @@
# (optional) URL to Gnocchi.
# Defaults to: $::os_service_default.
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the aodh config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
@ -304,6 +309,7 @@ class aodh (
$database_retry_interval = undef,
$database_max_overflow = undef,
$gnocchi_url = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$verbose = undef,
) inherits aodh::params {
@ -317,6 +323,10 @@ class aodh (
tag => ['openstack', 'aodh-package'],
}
resources { 'aodh_config':
purge => $purge_config,
}
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}

View File

@ -5,9 +5,13 @@ describe 'aodh' do
shared_examples 'aodh' do
context 'with default parameters' do
it 'contains the logging class' do
is_expected.to contain_class('aodh::logging')
end
let :params do
{ :purge_config => false }
end
it 'contains the logging class' do
is_expected.to contain_class('aodh::logging')
end
it 'installs packages' do
is_expected.to contain_package('aodh').with(
@ -32,6 +36,13 @@ describe 'aodh' do
is_expected.to contain_aodh_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_aodh_config('database/alarm_history_time_to_live').with_value('<SERVICE DEFAULT>')
end
it 'passes purge to resource' do
is_expected.to contain_resources('aodh_config').with({
:purge => false
})
end
end
context 'with overridden parameters' do