Merge "Add rabbit_ha_queues option"

This commit is contained in:
Jenkins 2015-11-20 03:35:56 +00:00 committed by Gerrit Code Review
commit 9feac68da1
3 changed files with 23 additions and 3 deletions

View File

@ -54,6 +54,10 @@
# (Optional) Virtual_host 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.
@ -252,6 +256,7 @@ class heat(
$rabbit_userid = 'guest',
$rabbit_password = '',
$rabbit_virtual_host = '/',
$rabbit_ha_queues = undef,
$rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = 2,
$rabbit_use_ssl = false,
@ -340,10 +345,14 @@ class heat(
}
}
if size($rabbit_hosts) > 1 {
heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
if $rabbit_ha_queues == undef {
if size($rabbit_hosts) > 1 {
heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues }
}
heat_config {

View File

@ -178,6 +178,16 @@ describe 'heat' do
it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) }
end
shared_examples_for 'single rabbit_host with ha queues' do
let :params do
req_params.merge({'rabbit_ha_queues' => true})
end
it 'should contain rabbit_ha_queues' do
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
end
end
shared_examples_for 'rabbit with heartbeat configured' do
it 'configures rabbit' do
is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )

View File

@ -30,6 +30,7 @@ describe 'heat::keystone::auth' do
:service_type => 'orchestration',
:region => 'RegionOne',
:tenant => 'services',
:configure_user_role => true,
:public_url => 'http://127.0.0.1:8004/v1/%(tenant_id)s',
:admin_url => 'http://127.0.0.1:8004/v1/%(tenant_id)s',
:internal_url => 'http://127.0.0.1:8004/v1/%(tenant_id)s',