#
# == parameters
#
+# [*http_timeout*]
+# timeout seconds for HTTP requests
+# Defaults to 600
+# [*event_time_to_live*]
+# number of seconds that events are kept in the database for
+# (<= 0 means forever)
+# Defaults to -1
+# [*metering_time_to_live*]
+# number of seconds that samples are kept in the database for
+# (<= 0 means forever)
+# Defaults to -1
# [*metering_secret*]
# secret key for signing messages. Mandatory.
# [*notification_topics*]
# (optional) various QPID options
#
class ceilometer(
+ $http_timeout = '600',
+ $event_time_to_live = '-1',
+ $metering_time_to_live = '-1',
$metering_secret = false,
$notification_topics = ['notifications'],
$package_ensure = 'present',
# Once we got here, we can act as an honey badger on the rpc used.
ceilometer_config {
+ 'DEFAULT/http_timeout' : value => $http_timeout;
'DEFAULT/rpc_backend' : value => $rpc_backend;
'publisher/metering_secret' : value => $metering_secret, secret => true;
'DEFAULT/debug' : value => $debug;
'DEFAULT/verbose' : value => $verbose;
'DEFAULT/notification_topics' : value => join($notification_topics, ',');
+ 'database/event_time_to_live' : value => $event_time_to_live;
+ 'database/metering_time_to_live' : value => $metering_time_to_live;
}
# Log configuration
let :params do
{
- :metering_secret => 'metering-s3cr3t',
- :package_ensure => 'present',
- :debug => 'False',
- :log_dir => '/var/log/ceilometer',
- :verbose => 'False',
+ :http_timeout => '600',
+ :event_time_to_live => '604800',
+ :metering_time_to_live => '604800',
+ :metering_secret => 'metering-s3cr3t',
+ :package_ensure => 'present',
+ :debug => 'False',
+ :log_dir => '/var/log/ceilometer',
+ :verbose => 'False',
}
end
shared_examples_for 'ceilometer' do
+ it 'configures time to live for events and meters' do
+ is_expected.to contain_ceilometer_config('database/event_time_to_live').with_value( params[:event_time_to_live] )
+ is_expected.to contain_ceilometer_config('database/metering_time_to_live').with_value( params[:metering_time_to_live] )
+ end
+
+ it 'configures timeout for HTTP requests' do
+ is_expected.to contain_ceilometer_config('DEFAULT/http_timeout').with_value(params[:http_timeout])
+ end
+
context 'with rabbit_host parameter' do
before { params.merge!( rabbit_params ) }
it_configures 'a ceilometer base installation'