From 584440d30cd5c5a5ff7fd5bb241bb72888ec2198 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 9 Sep 2024 14:13:24 +0900 Subject: [PATCH] rabbitmq: Support queue manager options Change-Id: I83db5307f526b5824e9cf3de2cfbff7abb11d443 --- manifests/messaging/rabbit.pp | 18 ++++++++++++++++++ .../rabbit-queue-manager-a2ee5b50b6c46615.yaml | 5 +++++ spec/defines/oslo_messaging_rabbit_spec.rb | 9 +++++++++ 3 files changed, 32 insertions(+) create mode 100644 releasenotes/notes/rabbit-queue-manager-a2ee5b50b6c46615.yaml diff --git a/manifests/messaging/rabbit.pp b/manifests/messaging/rabbit.pp index ba26649..439f3e8 100644 --- a/manifests/messaging/rabbit.pp +++ b/manifests/messaging/rabbit.pp @@ -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 }, diff --git a/releasenotes/notes/rabbit-queue-manager-a2ee5b50b6c46615.yaml b/releasenotes/notes/rabbit-queue-manager-a2ee5b50b6c46615.yaml new file mode 100644 index 0000000..355f721 --- /dev/null +++ b/releasenotes/notes/rabbit-queue-manager-a2ee5b50b6c46615.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``oslo::messaging::rabbit`` defined resource type now supports options + for queue manager feature. diff --git a/spec/defines/oslo_messaging_rabbit_spec.rb b/spec/defines/oslo_messaging_rabbit_spec.rb index b96c44f..550981d 100644 --- a/spec/defines/oslo_messaging_rabbit_spec.rb +++ b/spec/defines/oslo_messaging_rabbit_spec.rb @@ -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('') is_expected.to contain_keystone_config('oslo_messaging_rabbit/rabbit_quorum_max_memory_bytes').with_value('') is_expected.to contain_keystone_config('oslo_messaging_rabbit/enable_cancel_on_failover').with_value('') + is_expected.to contain_keystone_config('oslo_messaging_rabbit/use_queue_manager').with_value('') + is_expected.to contain_keystone_config('oslo_messaging_rabbit/hostname').with_value('') + is_expected.to contain_keystone_config('oslo_messaging_rabbit/processname').with_value('') 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