Add ability to specify ttl and timeout parameters
Allow to override following ceilometer parameters: * time to live for events * time to live for meters * timeout for HTTP requests Change-Id: I083ac1ed90db96e69e2287acc9ec62956be0ae58
This commit is contained in:
parent
cf846dc532
commit
2ff489103b
|
@ -4,6 +4,17 @@
|
|||
#
|
||||
# == 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*]
|
||||
|
@ -94,6 +105,9 @@
|
|||
# (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',
|
||||
|
@ -278,11 +292,14 @@ class ceilometer(
|
|||
|
||||
# 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
|
||||
|
|
|
@ -4,6 +4,9 @@ describe 'ceilometer' do
|
|||
|
||||
let :params do
|
||||
{
|
||||
:http_timeout => '600',
|
||||
:event_time_to_live => '604800',
|
||||
:metering_time_to_live => '604800',
|
||||
:metering_secret => 'metering-s3cr3t',
|
||||
:package_ensure => 'present',
|
||||
:debug => 'False',
|
||||
|
@ -34,6 +37,15 @@ describe 'ceilometer' do
|
|||
|
||||
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'
|
||||
|
|
Loading…
Reference in New Issue