From 72234d6eb963686be8e397bbbb50347d45df19c0 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 29 Sep 2024 18:28:51 +0900 Subject: [PATCH] Expose parameter to customize [oslo_messaging_notifications] retry The parameter has been managed by puppet-oslo, but its value could not be set via this module. Change-Id: I62221868fdfbaab1abb865117378b193b4ce8756 --- manifests/notify/rabbitmq.pp | 47 +++++++++++-------- .../notification-retry-19b32f669308d331.yaml | 5 ++ spec/classes/glance_notify_rabbitmq_spec.rb | 7 ++- 3 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/notification-retry-19b32f669308d331.yaml diff --git a/manifests/notify/rabbitmq.pp b/manifests/notify/rabbitmq.pp index bd2a0c55..9d6a2f7d 100644 --- a/manifests/notify/rabbitmq.pp +++ b/manifests/notify/rabbitmq.pp @@ -2,14 +2,14 @@ # used to configure rabbitmq notifications for glance # # [*default_transport_url*] -# (optional) A URL representing the messaging driver to use and its full -# configuration. Transport URLs take the form: -# transport://user:pass@host1:port[,hostN:portN]/virtual_host -# Defaults to $facts['os_service_default'] +# (Optional) A URL representing the messaging driver to use and its full +# configuration. Transport URLs take the form: +# transport://user:pass@host1:port[,hostN:portN]/virtual_host +# Defaults to $facts['os_service_default'] # # [*rpc_response_timeout*] -# (Optional) Seconds to wait for a response from a call. -# Defaults to $facts['os_service_default'] +# (Optional) Seconds to wait for a response from a call. +# Defaults to $facts['os_service_default'] # # [*control_exchange*] # (Optional) The default exchange under which topics are scoped. May be @@ -21,11 +21,6 @@ # (Optional) Size of executor thread pool when executor is threading or eventlet. # Defaults to $facts['os_service_default']. # -# [*notification_transport_url*] -# (optional) Connection url for oslo messaging notification backend. An -# example rabbit url would be, rabbit://user:pass@host:port/virtual_host -# Defaults to $facts['os_service_default'] -# # [*rabbit_ha_queues*] # (Optional) Use HA queues in RabbitMQ (x-ha-policy: all). If you change this # option, you must wipe the RabbitMQ database. (boolean value) @@ -119,10 +114,6 @@ # more than one RabbitMQ node is provided in config. (string value) # Defaults to $facts['os_service_default'] # -# [*rabbit_notification_topic*] -# AMQP topic used for OpenStack notifications. (list value) -# Defaults to $facts['os_service_default'] -# # [*amqp_durable_queues*] # (optional) Define queues as "durable" to rabbitmq. (boolean value) # Defaults to $facts['os_service_default'] @@ -133,17 +124,30 @@ # (string value) # Defaults to $facts['os_service_default'] # -# [*notification_driver*] -# The Drivers(s) to handle sending notifications. Possible values are -# messaging, messagingv2, routing, log, test, noop (multi valued) +# [*notification_transport_url*] +# (Optional) Connection url for oslo messaging notification backend. An +# example rabbit url would be, rabbit://user:pass@host:port/virtual_host # Defaults to $facts['os_service_default'] # +# [*rabbit_notification_topic*] +# (Optional) AMQP topic used for OpenStack notifications. (list value) +# Defaults to $facts['os_service_default'] +# +# [*notification_driver*] +# (Optional) The Drivers(s) to handle sending notifications. Possible values +# are messaging, messagingv2, routing, log, test, noop (multi valued) +# Defaults to $facts['os_service_default'] +# +# [*notification_retry*] +# (Optional) The maximum number of attempts to re-sent a notification +# message, which failed to be delivered due to a recoverable error. +# Defaults to $facts['os_service_default']. +# class glance::notify::rabbitmq( $default_transport_url = $facts['os_service_default'], $rpc_response_timeout = $facts['os_service_default'], $control_exchange = $facts['os_service_default'], $executor_thread_pool_size = $facts['os_service_default'], - $notification_transport_url = $facts['os_service_default'], $rabbit_ha_queues = $facts['os_service_default'], $rabbit_heartbeat_timeout_threshold = $facts['os_service_default'], $rabbit_heartbeat_rate = $facts['os_service_default'], @@ -162,10 +166,12 @@ class glance::notify::rabbitmq( $kombu_ssl_version = $facts['os_service_default'], $kombu_reconnect_delay = $facts['os_service_default'], $kombu_failover_strategy = $facts['os_service_default'], - $rabbit_notification_topic = $facts['os_service_default'], $amqp_durable_queues = $facts['os_service_default'], $kombu_compression = $facts['os_service_default'], + $notification_transport_url = $facts['os_service_default'], + $rabbit_notification_topic = $facts['os_service_default'], $notification_driver = $facts['os_service_default'], + $notification_retry = $facts['os_service_default'], ) { include glance::deps @@ -204,5 +210,6 @@ class glance::notify::rabbitmq( driver => $notification_driver, transport_url => $notification_transport_url, topics => $rabbit_notification_topic, + retry => $notification_retry, } } diff --git a/releasenotes/notes/notification-retry-19b32f669308d331.yaml b/releasenotes/notes/notification-retry-19b32f669308d331.yaml new file mode 100644 index 00000000..3b277164 --- /dev/null +++ b/releasenotes/notes/notification-retry-19b32f669308d331.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``glance::notify::rabbitmq::notification_retry`` parameter has been + added. diff --git a/spec/classes/glance_notify_rabbitmq_spec.rb b/spec/classes/glance_notify_rabbitmq_spec.rb index 5e2bc3e3..f3619085 100644 --- a/spec/classes/glance_notify_rabbitmq_spec.rb +++ b/spec/classes/glance_notify_rabbitmq_spec.rb @@ -37,6 +37,7 @@ describe 'glance::notify::rabbitmq' do :driver => '', :transport_url => '', :topics => '', + :retry => '', ) } end @@ -47,7 +48,6 @@ describe 'glance::notify::rabbitmq' do :rpc_response_timeout => '120', :control_exchange => 'glance', :executor_thread_pool_size => 64, - :notification_transport_url => 'rabbit://user:pass@alt_host:1234/virt', :rabbit_ha_queues => true, :rabbit_heartbeat_timeout_threshold => '60', :rabbit_heartbeat_rate => '10', @@ -66,10 +66,12 @@ describe 'glance::notify::rabbitmq' do :kombu_ssl_version => 'TLSv1', :kombu_reconnect_delay => '5.0', :kombu_failover_strategy => 'shuffle', - :rabbit_notification_topic => 'notification', :amqp_durable_queues => true, :kombu_compression => 'gzip', + :notification_transport_url => 'rabbit://user:pass@alt_host:1234/virt', + :rabbit_notification_topic => 'notification', :notification_driver => 'messagingv2', + :notification_retry => 10, } end @@ -107,6 +109,7 @@ describe 'glance::notify::rabbitmq' do :driver => 'messagingv2', :transport_url => 'rabbit://user:pass@alt_host:1234/virt', :topics => 'notification', + :retry => 10, ) } end end