rabbitmq: Support queue manager options

Change-Id: I83db5307f526b5824e9cf3de2cfbff7abb11d443
This commit is contained in:
Takashi Kajinami 2024-09-09 14:13:24 +09:00
parent 25ada7c7bf
commit 584440d30c
3 changed files with 32 additions and 0 deletions

View File

@ -140,6 +140,18 @@
# cancel and notify consumers when queue is down.
# Defaults to $facts['os_service_default']
#
# [*use_queue_manager*]
# (Optional) Should we use consistent queue names or random ones.
# Defaults to $facts['os_service_default']
#
# [*hostname*]
# (Optional) Hostname used by queue manager.
# Defaults to $facts['os_service_default']
#
# [*processname*]
# (Optional) Process name used by queue manager.
# Defaults to $facts['os_service_default']
#
define oslo::messaging::rabbit(
$amqp_durable_queues = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
@ -167,6 +179,9 @@ define oslo::messaging::rabbit(
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
$enable_cancel_on_failover = $facts['os_service_default'],
$use_queue_manager = $facts['os_service_default'],
$hostname = $facts['os_service_default'],
$processname = $facts['os_service_default'],
){
$kombu_ssl_ca_certs_set = (!is_service_default($kombu_ssl_ca_certs) and ($kombu_ssl_ca_certs))
@ -220,6 +235,9 @@ define oslo::messaging::rabbit(
'oslo_messaging_rabbit/rabbit_quorum_max_memory_length' => { value => $rabbit_quorum_max_memory_length },
'oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes' => { value => $rabbit_quorum_max_memory_bytes },
'oslo_messaging_rabbit/enable_cancel_on_failover' => { value => $enable_cancel_on_failover },
'oslo_messaging_rabbit/use_queue_manager' => { value => $use_queue_manager },
'oslo_messaging_rabbit/hostname' => { value => $hostname },
'oslo_messaging_rabbit/processname' => { value => $processname },
'oslo_messaging_rabbit/ssl_ca_file' => { value => $kombu_ssl_ca_certs },
'oslo_messaging_rabbit/ssl_cert_file' => { value => $kombu_ssl_certfile },
'oslo_messaging_rabbit/ssl_key_file' => { value => $kombu_ssl_keyfile },

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``oslo::messaging::rabbit`` defined resource type now supports options
for queue manager feature.

View File

@ -30,6 +30,9 @@ describe 'oslo::messaging::rabbit' do
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/use_queue_manager').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/hostname').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/processname').with_value('<SERVICE DEFAULT>')
end
end
@ -48,6 +51,9 @@ describe 'oslo::messaging::rabbit' do
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:enable_cancel_on_failover => false,
:use_queue_manager => false,
:hostname => 'node1.example.com',
:processname => 'procname',
}
end
@ -64,6 +70,9 @@ describe 'oslo::messaging::rabbit' do
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_length').with_value(5)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value(1073741824)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value(false)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/use_queue_manager').with_value(false)
is_expected.to contain_keystone_config('oslo_messaging_rabbit/hostname').with_value('node1.example.com')
is_expected.to contain_keystone_config('oslo_messaging_rabbit/processname').with_value('procname')
end
end