diff --git a/manifests/init.pp b/manifests/init.pp index 8726bb1d8..6a6541645 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -219,6 +219,10 @@ # (optional) Location of rabbitmq installation. # Defaults to $::os_service_default # +# [*rabbit_ha_queues*] +# (Optional) Use HA queues in RabbitMQ. +# Defaults to undef. +# # [*rabbit_password*] # (optional) Password used to connect to rabbitmq. # Defaults to $::os_service_default @@ -567,6 +571,7 @@ class keystone( $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, $rabbit_use_ssl = $::os_service_default, + $rabbit_ha_queues = undef, $kombu_ssl_ca_certs = $::os_service_default, $kombu_ssl_certfile = $::os_service_default, $kombu_ssl_keyfile = $::os_service_default, @@ -828,17 +833,25 @@ class keystone( if ! is_service_default($rabbit_hosts) and $rabbit_hosts { keystone_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($rabbit_hosts, ','); - 'oslo_messaging_rabbit/rabbit_ha_queues': value => true; } } else { keystone_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host; 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port; - 'oslo_messaging_rabbit/rabbit_ha_queues': value => false; 'oslo_messaging_rabbit/rabbit_hosts': ensure => absent; } } + if $rabbit_ha_queues != undef { + keystone_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues } + } else { + if ! is_service_default($rabbit_hosts) and $rabbit_hosts { + keystone_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } + } else { + keystone_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false } + } + } + keystone_config { 'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl; 'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true; diff --git a/spec/classes/keystone_spec.rb b/spec/classes/keystone_spec.rb index 36b3cf70f..d71bebb60 100644 --- a/spec/classes/keystone_spec.rb +++ b/spec/classes/keystone_spec.rb @@ -105,6 +105,7 @@ describe 'keystone' do 'rabbit_userid' => 'admin', 'rabbit_heartbeat_timeout_threshold' => '60', 'rabbit_heartbeat_rate' => '10', + 'rabbit_ha_queues' => true, 'default_domain' => 'other_domain', 'using_domain_config' => false } @@ -237,6 +238,15 @@ describe 'keystone' do end end + it 'should ensure rabbit_ha_queues' do + if param_hash['rabbit_ha_queues'] + is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(param_hash['rabbit_ha_queues']) + else + is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(false) + end + + end + if param_hash['default_domain'] it { is_expected.to contain_keystone_domain(param_hash['default_domain']).with(:is_default => true) } it { is_expected.to contain_anchor('default_domain_created') }