From 32e7d18998329bcada966302e498eea2b03bc455 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 26 Sep 2024 11:18:34 +0900 Subject: [PATCH] Add support for [oslo_messaging_rabbit] enable_cancel_on_failover Depends-on: https://review.opendev.org/928440 Change-Id: I297aa13ac9c6d3dcc4c0b34fafe4ffefac86ee65 --- manifests/guestagent.pp | 1 + manifests/init.pp | 7 +++++++ .../notes/enable_cancel_on_failover-230b2088cad64cd9.yaml | 5 +++++ spec/classes/trove_guestagent_spec.rb | 1 + spec/classes/trove_init_spec.rb | 1 + 5 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/enable_cancel_on_failover-230b2088cad64cd9.yaml diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 7703c7fe..71b2763e 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -187,6 +187,7 @@ class trove::guestagent( rabbit_quorum_delivery_limit => $::trove::rabbit_quorum_delivery_limit, rabbit_quorum_max_memory_length => $::trove::rabbit_quorum_max_memory_length, rabbit_quorum_max_memory_bytes => $::trove::rabbit_quorum_max_memory_bytes, + enable_cancel_on_failover => $::trove::rabbit_enable_cancel_on_failover, } oslo::log { 'trove_guestagent_config': diff --git a/manifests/init.pp b/manifests/init.pp index c990633c..42103349 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -124,6 +124,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'] +# # [*kombu_reconnect_delay*] # (optional) How long to wait before reconnecting in response to an AMQP # consumer cancel notification. @@ -252,6 +257,7 @@ class trove( $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'], $kombu_ssl_ca_certs = $facts['os_service_default'], $kombu_ssl_certfile = $facts['os_service_default'], $kombu_ssl_keyfile = $facts['os_service_default'], @@ -369,5 +375,6 @@ class trove( 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, } } diff --git a/releasenotes/notes/enable_cancel_on_failover-230b2088cad64cd9.yaml b/releasenotes/notes/enable_cancel_on_failover-230b2088cad64cd9.yaml new file mode 100644 index 00000000..804f17b4 --- /dev/null +++ b/releasenotes/notes/enable_cancel_on_failover-230b2088cad64cd9.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``trove::rabbit_enable_cancel_on_failover`` parameter has been + added. diff --git a/spec/classes/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index 076cf7a1..8b5a972e 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -64,6 +64,7 @@ describe 'trove::guestagent' do :rabbit_quorum_delivery_limit => '', :rabbit_quorum_max_memory_length => '', :rabbit_quorum_max_memory_bytes => '', + :enable_cancel_on_failover => '', ) is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('') diff --git a/spec/classes/trove_init_spec.rb b/spec/classes/trove_init_spec.rb index 19b45209..e83161e3 100644 --- a/spec/classes/trove_init_spec.rb +++ b/spec/classes/trove_init_spec.rb @@ -72,6 +72,7 @@ describe 'trove' do :rabbit_quorum_delivery_limit => '', :rabbit_quorum_max_memory_length => '', :rabbit_quorum_max_memory_bytes => '', + :enable_cancel_on_failover => '', ) is_expected.to contain_oslo__messaging__notifications('trove_config').with( :transport_url => '',