Add a rabbit_transient_queues_ttl and amqp_auto_delete params

Since transient_queues_ttl is also managed by oslo::messaging::rabbit,
there's no way to use ironic_config to set it, so this patch is mandatory
for one to set rabbit_transient_queues_ttl in ironic.conf.

Same applies to ironic_inspector_config.

Change-Id: I95625460e2b79cd071819edc6b397cae907c9bf4
This commit is contained in:
Thomas Goirand 2025-03-18 11:47:41 +01:00
parent c1f72b157a
commit 88168754f4
6 changed files with 56 additions and 0 deletions

View File

@ -110,6 +110,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
@ -169,6 +177,10 @@
# (optional) Define queues as "durable" to rabbitmq. (boolean value)
# Defaults to $facts['os_service_default']
#
# [*amqp_auto_delete*]
# (Optional) Define if transient queues should be auto-deleted (boolean value)
# Defaults to $facts['os_service_default']
#
# [*sync_db*]
# Enable dbsync
# Defaults to true
@ -252,6 +264,7 @@ class ironic (
$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'],
@ -264,6 +277,7 @@ class ironic (
$kombu_failover_strategy = $facts['os_service_default'],
$kombu_compression = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
$amqp_auto_delete = $facts['os_service_default'],
Boolean $sync_db = true,
Boolean $db_online_data_migrations = false,
Boolean $purge_config = false,
@ -333,6 +347,7 @@ class ironic (
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_failover_strategy => $kombu_failover_strategy,
amqp_durable_queues => $amqp_durable_queues,
amqp_auto_delete => $amqp_auto_delete,
kombu_compression => $kombu_compression,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_certfile => $kombu_ssl_certfile,
@ -341,6 +356,7 @@ class ironic (
rabbit_ha_queues => $rabbit_ha_queues,
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,

View File

@ -250,6 +250,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
@ -309,6 +317,10 @@
# (optional) Define queues as "durable" to rabbitmq. (boolean value)
# Defaults to $facts['os_service_default']
#
# [*amqp_auto_delete*]
# (Optional) Define if transient queues should be auto-deleted (boolean value)
# Defaults to $facts['os_service_default']
#
# [*standalone*]
# (optional) Whether to run ironic-inspector as a standalone service.
# Defaults to true
@ -373,6 +385,7 @@ class ironic::inspector (
$rabbit_qos_prefetch_count = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'],
$rabbit_transient_queues_ttl = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
@ -386,6 +399,7 @@ class ironic::inspector (
$kombu_failover_strategy = $facts['os_service_default'],
$kombu_compression = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
$amqp_auto_delete = $facts['os_service_default'],
Boolean $standalone = true,
# DEPRECATED PARAMETERS
$rabbit_heartbeat_in_pthread = undef,
@ -515,6 +529,7 @@ class ironic::inspector (
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_failover_strategy => $kombu_failover_strategy,
amqp_durable_queues => $amqp_durable_queues,
amqp_auto_delete => $amqp_auto_delete,
kombu_compression => $kombu_compression,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_certfile => $kombu_ssl_certfile,
@ -523,6 +538,7 @@ class ironic::inspector (
rabbit_ha_queues => $rabbit_ha_queues,
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,

View File

@ -0,0 +1,6 @@
---
features:
- |
Add a new ``amqp_auto_delete`` parameter, so that transient queues are
automatically deleted. This parameter is available for both the top level
``ironic`` and the ``ironic::inspector`` classes.

View File

@ -0,0 +1,6 @@
---
features:
- |
A new parameter ``rabbit_transient_queues_ttl`` has been added to the
ironic and ironic::inspector classes to configure how long transtient
queue should stay until they are automatically deleted.

View File

@ -80,6 +80,7 @@ describe 'ironic' do
:kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
:amqp_auto_delete => '<SERVICE DEFAULT>',
:kombu_compression => '<SERVICE DEFAULT>',
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
@ -87,6 +88,7 @@ describe 'ironic' do
:kombu_ssl_version => '<SERVICE DEFAULT>',
:rabbit_ha_queues => '<SERVICE DEFAULT>',
:rabbit_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>',
@ -122,6 +124,7 @@ describe 'ironic' do
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:amqp_auto_delete => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
@ -129,6 +132,7 @@ describe 'ironic' do
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
@ -168,6 +172,7 @@ describe 'ironic' do
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:amqp_auto_delete => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
@ -175,6 +180,7 @@ describe 'ironic' do
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,

View File

@ -140,6 +140,7 @@ describe 'ironic::inspector' do
:kombu_reconnect_delay => '<SERVICE DEFAULT>',
:kombu_failover_strategy => '<SERVICE DEFAULT>',
:amqp_durable_queues => '<SERVICE DEFAULT>',
:amqp_auto_delete => '<SERVICE DEFAULT>',
:kombu_compression => '<SERVICE DEFAULT>',
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
@ -147,6 +148,7 @@ describe 'ironic::inspector' do
:kombu_ssl_version => '<SERVICE DEFAULT>',
:rabbit_ha_queues => '<SERVICE DEFAULT>',
:rabbit_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>',
@ -255,6 +257,7 @@ describe 'ironic::inspector' do
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:amqp_auto_delete => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
@ -262,6 +265,7 @@ describe 'ironic::inspector' do
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
@ -293,6 +297,7 @@ describe 'ironic::inspector' do
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:amqp_auto_delete => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
@ -300,6 +305,7 @@ describe 'ironic::inspector' do
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_queues_ttl => 60,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,