From a2686b359eae77fba6d895cb6aef879951cd76b2 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 26 Sep 2024 11:16:23 +0900 Subject: [PATCH] Add support for [oslo_messaging_rabbit] enable_cancel_on_failover Depends-on: https://review.opendev.org/928440 Change-Id: Ib6a3e185c22f829386822209022e85508185316e --- manifests/init.pp | 7 ++++ ...e_cancel_on_failover-9917be4e60bc9d78.yaml | 5 +++ spec/classes/mistral_init_spec.rb | 37 ++++++++++--------- 3 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/enable_cancel_on_failover-9917be4e60bc9d78.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 43b11a0..c8828ac 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -89,6 +89,11 @@ # (Optional) Limit the number of memory bytes used by the quorum queue. # Defaults to $facts['os_service_default'] # +# [*rabbit_enable_cancel_on_failover*] +# (Optional) Enable x-cancel-on-ha-failover flag so that rabbitmq server will +# cancel and notify consumers when queue is down. +# Defaults to $facts['os_service_default'] +# # [*rabbit_use_ssl*] # (optional) Connect over SSL for RabbitMQ # Defaults to $facts['os_service_default'] @@ -197,6 +202,7 @@ class mistral( $rabbit_quorum_delivery_limit = $facts['os_service_default'], $rabbit_quorum_max_memory_length = $facts['os_service_default'], $rabbit_quorum_max_memory_bytes = $facts['os_service_default'], + $rabbit_enable_cancel_on_failover = $facts['os_service_default'], $rabbit_use_ssl = $facts['os_service_default'], $service_down_time = $facts['os_service_default'], $report_interval = $facts['os_service_default'], @@ -272,6 +278,7 @@ class mistral( rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit, rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length, rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes, + enable_cancel_on_failover => $rabbit_enable_cancel_on_failover, } if $sync_db { diff --git a/releasenotes/notes/enable_cancel_on_failover-9917be4e60bc9d78.yaml b/releasenotes/notes/enable_cancel_on_failover-9917be4e60bc9d78.yaml new file mode 100644 index 0000000..8ddee34 --- /dev/null +++ b/releasenotes/notes/enable_cancel_on_failover-9917be4e60bc9d78.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``mistral::rabbit_enable_cancel_on_failover`` parameter has been + added. diff --git a/spec/classes/mistral_init_spec.rb b/spec/classes/mistral_init_spec.rb index 75118ef..c49cdf6 100644 --- a/spec/classes/mistral_init_spec.rb +++ b/spec/classes/mistral_init_spec.rb @@ -38,24 +38,25 @@ describe 'mistral' do :topics => '' ) is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( - :rabbit_use_ssl => '', - :heartbeat_timeout_threshold => '', - :heartbeat_rate => '', - :heartbeat_in_pthread => '', - :rabbit_qos_prefetch_count => '', - :kombu_reconnect_delay => '', - :kombu_failover_strategy => '', - :amqp_durable_queues => '', - :kombu_ssl_ca_certs => '', - :kombu_ssl_certfile => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_version => '', - :rabbit_ha_queues => '', - :rabbit_quorum_queue => '', - :rabbit_transient_quorum_queue => '', - :rabbit_quorum_delivery_limit => '', - :rabbit_quorum_max_memory_length => '', - :rabbit_quorum_max_memory_bytes => '', + :rabbit_use_ssl => '', + :heartbeat_timeout_threshold => '', + :heartbeat_rate => '', + :heartbeat_in_pthread => '', + :rabbit_qos_prefetch_count => '', + :kombu_reconnect_delay => '', + :kombu_failover_strategy => '', + :amqp_durable_queues => '', + :kombu_ssl_ca_certs => '', + :kombu_ssl_certfile => '', + :kombu_ssl_keyfile => '', + :kombu_ssl_version => '', + :rabbit_ha_queues => '', + :rabbit_quorum_queue => '', + :rabbit_transient_quorum_queue => '', + :rabbit_quorum_delivery_limit => '', + :rabbit_quorum_max_memory_length => '', + :rabbit_quorum_max_memory_bytes => '', + :enable_cancel_on_failover => '', ) is_expected.to contain_mistral_config('openstack_actions/os_actions_endpoint_type').with( :value => ''