Add support for alarm_history_time_to_live parameter

This parameter should be configured for Aodh instead of Ceilometer.

Change-Id: I033599af813350911c001b7dcff1a90d6008cc67
This commit is contained in:
iberezovskiy 2016-03-04 19:43:01 +03:00
parent 985b2ee77f
commit bcc2d1a9e9
2 changed files with 15 additions and 4 deletions

View File

@ -8,6 +8,11 @@
# (optional) The state of aodh packages
# Defaults to 'present'
#
# [*alarm_history_time_to_live*]
# (Optional) Number of seconds that alarm histories are kept in the database for
# (<= 0 means forever)
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# rabbit (for rabbitmq)
@ -205,6 +210,7 @@
#
class aodh (
$ensure_package = 'present',
$alarm_history_time_to_live = $::os_service_default,
$rpc_backend = 'rabbit',
$rabbit_host = 'localhost',
$rabbit_hosts = undef,
@ -351,9 +357,10 @@ class aodh (
aodh_config { 'DEFAULT/notification_driver': ensure => absent; }
}
aodh_config {
'DEFAULT/rpc_backend': value => $rpc_backend;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/gnocchi_url': value => $gnocchi_url;
'DEFAULT/rpc_backend': value => $rpc_backend;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/gnocchi_url': value => $gnocchi_url;
'database/alarm_history_time_to_live': value => $alarm_history_time_to_live;
}
}

View File

@ -27,6 +27,7 @@ describe 'aodh' do
is_expected.to contain_aodh_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
is_expected.to contain_aodh_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
is_expected.to contain_aodh_config('DEFAULT/notification_driver').with_ensure('absent')
is_expected.to contain_aodh_config('database/alarm_history_time_to_live').with_value('<SERVICE DEFAULT>')
end
end
@ -44,7 +45,9 @@ describe 'aodh' do
:ensure_package => '2012.1.1-15.el6',
:gnocchi_url => 'http://127.0.0.1:8041',
:notification_driver => 'ceilometer.compute.aodh_notifier',
:notification_topics => 'openstack' }
:notification_topics => 'openstack',
:alarm_history_time_to_live => '604800',
}
end
it 'configures rabbit' do
@ -56,6 +59,7 @@ describe 'aodh' do
is_expected.to contain_aodh_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('/')
is_expected.to contain_aodh_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
is_expected.to contain_aodh_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
is_expected.to contain_aodh_config('database/alarm_history_time_to_live').with_value('604800')
end
it 'configures various things' do