Add ability to override notification_topics
The notification_topics value was hard-coded to 'notifications'. This adds the ability to configure its value. Change-Id: Ifa831dcc558d41f0de967e5c787ba349a06469d0 Closes-bug: #1273883
This commit is contained in:
parent
a86e117b1b
commit
da165d422a
|
@ -55,19 +55,20 @@
|
|||
#
|
||||
|
||||
class ceilometer(
|
||||
$metering_secret = false,
|
||||
$package_ensure = 'present',
|
||||
$debug = false,
|
||||
$log_dir = '/var/log/ceilometer',
|
||||
$verbose = false,
|
||||
$use_syslog = false,
|
||||
$log_facility = 'LOG_USER',
|
||||
$rpc_backend = 'ceilometer.openstack.common.rpc.impl_kombu',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_port = 5672,
|
||||
$rabbit_hosts = undef,
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_password = '',
|
||||
$metering_secret = false,
|
||||
$notification_topics = ['notifications'],
|
||||
$package_ensure = 'present',
|
||||
$debug = false,
|
||||
$log_dir = '/var/log/ceilometer',
|
||||
$verbose = false,
|
||||
$use_syslog = false,
|
||||
$log_facility = 'LOG_USER',
|
||||
$rpc_backend = 'ceilometer.openstack.common.rpc.impl_kombu',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_port = 5672,
|
||||
$rabbit_hosts = undef,
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_password = '',
|
||||
$rabbit_virtual_host = '/',
|
||||
$qpid_hostname = 'localhost',
|
||||
$qpid_port = 5672,
|
||||
|
@ -86,7 +87,6 @@ class ceilometer(
|
|||
|
||||
validate_string($metering_secret)
|
||||
|
||||
|
||||
include ceilometer::params
|
||||
|
||||
File {
|
||||
|
@ -180,7 +180,7 @@ class ceilometer(
|
|||
'publisher/metering_secret' : value => $metering_secret;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/notification_topics' : value => 'notifications';
|
||||
'DEFAULT/notification_topics' : value => join($notification_topics, ',');
|
||||
}
|
||||
|
||||
# Log configuration
|
||||
|
|
|
@ -132,6 +132,10 @@ describe 'ceilometer' do
|
|||
it { should contain_ceilometer_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||
end
|
||||
|
||||
it 'configures notification_topics' do
|
||||
should contain_ceilometer_config('DEFAULT/notification_topics').with_value('notifications')
|
||||
end
|
||||
|
||||
it 'configures syslog to be disabled by default' do
|
||||
should contain_ceilometer_config('DEFAULT/use_syslog').with_value('false')
|
||||
end
|
||||
|
@ -153,8 +157,12 @@ describe 'ceilometer' do
|
|||
it { should contain_ceilometer_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }
|
||||
end
|
||||
|
||||
it 'configures notification_topics' do
|
||||
should contain_ceilometer_config('DEFAULT/notification_topics').with_value('notifications')
|
||||
context 'with overriden notification_topics parameter' do
|
||||
before { params.merge!( :notification_topics => ['notifications', 'custom']) }
|
||||
|
||||
it 'configures notification_topics' do
|
||||
should contain_ceilometer_config('DEFAULT/notification_topics').with_value('notifications,custom')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue