# should the daemons log debug messages. Optional. Defaults to 'False'
# [*log_dir*]
# (optional) directory to which ceilometer logs are sent.
+# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/ceilometer'
# [*verbose*]
# should the daemons log verbose messages. Optional. Defaults to 'False'
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'
# [*rpc_backend*]
-# (optional) what rpc/queuing service to use
-# Defaults to impl_kombu (rabbitmq)
-#
+# (optional) what rpc/queuing service to use
+# Defaults to impl_kombu (rabbitmq)
# [*rabbit_host*]
# ip or hostname of the rabbit server. Optional. Defaults to '127.0.0.1'
# [*rabbit_port*]
}
# Once we got here, we can act as an honey badger on the rpc used.
-
ceilometer_config {
'DEFAULT/rpc_backend' : value => $rpc_backend;
'publisher/metering_secret' : value => $metering_secret;
'DEFAULT/debug' : value => $debug;
- 'DEFAULT/log_dir' : value => $log_dir;
'DEFAULT/verbose' : value => $verbose;
# Fix a bad default value in ceilometer.
# Fixed in https://review.openstack.org/#/c/18487/
'DEFAULT/notification_topics' : value => 'notifications';
}
+ # Log configuration
+ if $log_dir {
+ ceilometer_config {
+ 'DEFAULT/log_dir' : value => $log_dir;
+ }
+ } else {
+ ceilometer_config {
+ 'DEFAULT/log_dir' : ensure => absent;
+ }
+ }
+
# Syslog configuration
if $use_syslog {
ceilometer_config {
it { expect { should raise_error(Puppet::Error) } }
end
- it 'configures logging, debug and verbosity' do
+ it 'configures debug and verbosity' do
should contain_ceilometer_config('DEFAULT/debug').with_value( params[:debug] )
- should contain_ceilometer_config('DEFAULT/log_dir').with_value( params[:log_dir] )
should contain_ceilometer_config('DEFAULT/verbose').with_value( params[:verbose] )
end
+ it 'configures logging directory by default' do
+ should contain_ceilometer_config('DEFAULT/log_dir').with_value( params[:log_dir] )
+ end
+
+ context 'with logging directory disabled' do
+ before { params.merge!( :log_dir => false) }
+
+ it { should contain_ceilometer_config('DEFAULT/log_dir').with_ensure('absent') }
+ end
+
it 'configures syslog to be disabled by default' do
should contain_ceilometer_config('DEFAULT/use_syslog').with_value('false')
end