Merge "Fixed issue with rabbit_ha_queues parameter"
This commit is contained in:
@@ -149,6 +149,10 @@
|
||||
# multiple RabbitMQ Brokers.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*rabbit_ha_queues*]
|
||||
# (Optional) Use HA queues in RabbitMQ.
|
||||
# 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.
|
||||
@@ -293,6 +297,7 @@ class neutron (
|
||||
$rabbit_host = 'localhost',
|
||||
$rabbit_hosts = false,
|
||||
$rabbit_port = 5672,
|
||||
$rabbit_ha_queues = undef,
|
||||
$rabbit_user = 'guest',
|
||||
$rabbit_virtual_host = $::os_service_default,
|
||||
$rabbit_heartbeat_timeout_threshold = 0,
|
||||
@@ -452,12 +457,20 @@ class neutron (
|
||||
}
|
||||
if $rabbit_hosts {
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
if $rabbit_ha_queues == undef {
|
||||
if $rabbit_hosts {
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
|
||||
}
|
||||
} else {
|
||||
neutron_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues }
|
||||
}
|
||||
|
||||
neutron_config {
|
||||
|
@@ -45,6 +45,12 @@ describe 'neutron' do
|
||||
it_configures 'rabbit HA with multiple hosts'
|
||||
end
|
||||
|
||||
context 'with rabbit_ha_queues set to false and with rabbit_hosts' do
|
||||
before { params.merge!( :rabbit_ha_queues => 'false',
|
||||
:rabbit_hosts => ['rabbit:5673'] ) }
|
||||
it_configures 'rabbit_ha_queues set to false'
|
||||
end
|
||||
|
||||
it 'configures logging' do
|
||||
is_expected.to contain_neutron_config('DEFAULT/log_file').with_ensure('absent')
|
||||
is_expected.to contain_neutron_config('DEFAULT/log_dir').with_value(params[:log_dir])
|
||||
@@ -164,6 +170,12 @@ describe 'neutron' do
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'rabbit_ha_queues set to false' do
|
||||
it 'in neutron.conf' do
|
||||
is_expected.to contain_neutron_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(false)
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'with SSL socket options set' do
|
||||
before do
|
||||
params.merge!(
|
||||
|
Reference in New Issue
Block a user