Description: Add amqp_auto_delete and rabbit_transient_queues_ttl params
 The amqp_auto_delete option needs this patch:
 https://review.opendev.org/c/openstack/puppet-oslo/+/944132
 .
 Since transient_queues_ttl is also managed by oslo::messaging::rabbit,
 there's no way to use keystone_config to set it, so this patch is
 mandatory for one to set rabbit_transient_queues_ttl in keystone.conf.
Author: Thomas Goirand <zigo@debian.org>
Date: Thu, 13 Mar 2025 09:49:37 +0100
Change-Id: I86e796d2ac9879eea85bfe822616083c4dc588d1
Forwarded: https://review.opendev.org/c/openstack/puppet-keystone/+/944195
Last-Update: 2025-03-13

Index: puppet-module-keystone/manifests/init.pp
===================================================================
--- puppet-module-keystone.orig/manifests/init.pp
+++ puppet-module-keystone/manifests/init.pp
@@ -104,6 +104,14 @@
 #   (Optional) Use quorum queues for transients queues in RabbitMQ.
 #   Defaults to $facts['os_service_default']
 #
+# [*rabbit_transient_queues_ttl*]
+#   (Optional) Positive integer representing duration in seconds for
+#   queue TTL (x-expires). Queues which are unused for the duration
+#   of the TTL are automatically deleted.
+#   The parameter affects only reply and fanout queues. (integer value)
+#   Min to 1
+#   Defaults to $facts['os_service_default']
+#
 # [*rabbit_quorum_delivery_limit*]
 #   (Optional) Each time a message is rdelivered to a consumer, a counter is
 #   incremented. Once the redelivery count exceeds the delivery limit
@@ -358,6 +366,10 @@
 #   in the keystone config.
 #   Defaults to false.
 #
+# [*amqp_auto_delete*]
+#   (Optional) Define if transient queues should be auto-deleted (boolean value)
+#   Defaults to $facts['os_service_default']
+#
 # [*amqp_durable_queues*]
 #   (Optional) Whether to use durable queues in AMQP.
 #   Defaults to $facts['os_service_default'].
@@ -404,6 +416,7 @@ class keystone(
   $rabbit_ha_queues                               = $facts['os_service_default'],
   $rabbit_quorum_queue                            = $facts['os_service_default'],
   $rabbit_transient_quorum_queue                  = $facts['os_service_default'],
+  $rabbit_transient_queues_ttl                    = $facts['os_service_default'],
   $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'],
@@ -447,6 +460,7 @@ class keystone(
   $max_request_body_size                          = $facts['os_service_default'],
   Boolean $purge_config                           = false,
   $amqp_durable_queues                            = $facts['os_service_default'],
+  $amqp_auto_delete                               = $facts['os_service_default'],
   # DEPRECATED PARAMETERS
   $client_package_ensure                          = undef,
   $catalog_template_file                          = undef,
@@ -569,8 +583,10 @@ class keystone(
     heartbeat_in_pthread            => $rabbit_heartbeat_in_pthread,
     rabbit_qos_prefetch_count       => $rabbit_qos_prefetch_count,
     amqp_durable_queues             => $amqp_durable_queues,
+    amqp_auto_delete                => $amqp_auto_delete,
     rabbit_quorum_queue             => $rabbit_quorum_queue,
     rabbit_transient_quorum_queue   => $rabbit_transient_quorum_queue,
+    rabbit_transient_queues_ttl     => $rabbit_transient_queues_ttl,
     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,
Index: puppet-module-keystone/releasenotes/notes/amqp_auto_delete-f22621cced65e5f4.yaml
===================================================================
--- /dev/null
+++ puppet-module-keystone/releasenotes/notes/amqp_auto_delete-f22621cced65e5f4.yaml
@@ -0,0 +1,5 @@
+---
+features:
+  - |
+    Add a new `amqp_auto_delete` parameter, so that transient queues are
+    automatically deleted.
Index: puppet-module-keystone/releasenotes/notes/transient_queues_ttl-a9709a5539d0202a.yaml
===================================================================
--- /dev/null
+++ puppet-module-keystone/releasenotes/notes/transient_queues_ttl-a9709a5539d0202a.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    A new parameter ``rabbit_transient_queues_ttl`` has been added to the
+    heat init class to configure how long transtient queue should stay until
+    they are automatically deleted.
Index: puppet-module-keystone/spec/classes/keystone_init_spec.rb
===================================================================
--- puppet-module-keystone.orig/spec/classes/keystone_init_spec.rb
+++ puppet-module-keystone/spec/classes/keystone_init_spec.rb
@@ -82,8 +82,10 @@ describe 'keystone' do
           :heartbeat_in_pthread            => '<SERVICE DEFAULT>',
           :rabbit_qos_prefetch_count       => '<SERVICE DEFAULT>',
           :amqp_durable_queues             => '<SERVICE DEFAULT>',
+          :amqp_auto_delete                => '<SERVICE DEFAULT>',
           :rabbit_quorum_queue             => '<SERVICE DEFAULT>',
           :rabbit_transient_quorum_queue   => '<SERVICE DEFAULT>',
+          :rabbit_transient_queues_ttl     => '<SERVICE DEFAULT>',
           :rabbit_quorum_delivery_limit    => '<SERVICE DEFAULT>',
           :rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
           :rabbit_quorum_max_memory_bytes  => '<SERVICE DEFAULT>',
