Merge "Add rabbit_ha_queues option"

This commit is contained in:
Jenkins 2016-01-25 22:46:34 +00:00 committed by Gerrit Code Review
commit 4f3365c75c
2 changed files with 22 additions and 0 deletions
manifests
spec/classes

@ -89,6 +89,10 @@
# (Optional) virtualhost to use.
# Defaults to '/'.
#
# [*rabbit_ha_queues*]
# (Optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to undef.
#
# [*rabbit_heartbeat_timeout_threshold*]
# (Optional) Number of seconds after which the RabbitMQ broker is considered
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
@ -171,6 +175,7 @@ class ceilometer(
$rabbit_userid = 'guest',
$rabbit_password = '',
$rabbit_virtual_host = '/',
$rabbit_ha_queues = undef,
$rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = 2,
$amqp_durable_queues = $::os_service_default,
@ -249,11 +254,15 @@ class ceilometer(
}
}
if $rabbit_ha_queues == undef {
if size($rabbit_hosts) > 1 {
ceilometer_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
ceilometer_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
ceilometer_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues }
}
ceilometer_config {
'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid;

@ -45,6 +45,12 @@ describe 'ceilometer' do
it_configures 'rabbit with SSL support'
it_configures 'rabbit without HA support (with backward compatibility)'
it_configures 'rabbit with connection heartbeats'
context 'with rabbit_ha_queues' do
before { params.merge!( rabbit_params ).merge!( :rabbit_ha_queues => true ) }
it_configures 'rabbit with rabbit_ha_queues'
end
end
context 'with rabbit_hosts parameter' do
@ -163,6 +169,13 @@ describe 'ceilometer' do
end
shared_examples_for 'rabbit with rabbit_ha_queues' do
it 'configures rabbit' do
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value( params[:rabbit_ha_queues] )
end
end
shared_examples_for 'rabbit with HA support' do
it 'configures rabbit' do