From 07ff90437db821b4d54cd6618f949a68e563e108 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 30 Sep 2024 22:57:54 +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: Ib84c596fdb77d1fdc2ec66a66a85b212cfeca65d --- manifests/init.pp | 27 ++++++++++++------- .../notification-retry-8f6b11a94613fdc8.yaml | 4 +++ spec/classes/watcher_init_spec.rb | 7 +++-- 3 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/notification-retry-8f6b11a94613fdc8.yaml diff --git a/manifests/init.pp b/manifests/init.pp index daf9220..b2af4c5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -125,19 +125,24 @@ # Defaults to $facts['os_service_default'] # # [*notification_transport_url*] -# (optional) A URL representing the messaging driver to use for notifications -# 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 for notifications +# and its full configuration. Transport URLs take the form: +# transport://user:pass@host1:port[,hostN:portN]/virtual_host +# Defaults to $facts['os_service_default'] # # [*notification_driver*] -# (optional) Driver or drivers to handle sending notifications. -# Value can be a string or a list. -# Defaults to $facts['os_service_default'] +# (Optional) Driver or drivers to handle sending notifications. +# Value can be a string or a list. +# Defaults to $facts['os_service_default'] # # [*notification_topics*] -# (optional) AMQP topic used for OpenStack notifications -# Defaults to $facts['os_service_default'] +# (Optional) AMQP topic used for OpenStack notifications +# 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']. # # [*purge_config*] # (optional) Whether to set only the specified config options @@ -149,7 +154,6 @@ # Daniel Pawlik # class watcher ( - Boolean $purge_config = false, $package_ensure = 'present', $rabbit_login_method = $facts['os_service_default'], $rabbit_retry_interval = $facts['os_service_default'], @@ -176,6 +180,8 @@ class watcher ( $notification_transport_url = $facts['os_service_default'], $notification_driver = $facts['os_service_default'], $notification_topics = $facts['os_service_default'], + $notification_retry = $facts['os_service_default'], + Boolean $purge_config = false, ) { include openstacklib::openstackclient @@ -227,6 +233,7 @@ class watcher ( transport_url => $notification_transport_url, driver => $notification_driver, topics => $notification_topics, + retry => $notification_retry, } } diff --git a/releasenotes/notes/notification-retry-8f6b11a94613fdc8.yaml b/releasenotes/notes/notification-retry-8f6b11a94613fdc8.yaml new file mode 100644 index 0000000..c4d9936 --- /dev/null +++ b/releasenotes/notes/notification-retry-8f6b11a94613fdc8.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``watcher::notification_retry`` parameter has been added. diff --git a/spec/classes/watcher_init_spec.rb b/spec/classes/watcher_init_spec.rb index cc7e57e..9be8d3f 100644 --- a/spec/classes/watcher_init_spec.rb +++ b/spec/classes/watcher_init_spec.rb @@ -51,7 +51,8 @@ describe 'watcher' do is_expected.to contain_oslo__messaging__notifications('watcher_config').with( :transport_url => '', :driver => '', - :topics => '' + :topics => '', + :retry => '', ) end @@ -80,6 +81,7 @@ describe 'watcher' do :notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673', :notification_driver => 'messaging', :notification_topics => 'notifications', + :notification_retry => 10, } end it 'configures messaging' do @@ -107,7 +109,8 @@ describe 'watcher' do is_expected.to contain_oslo__messaging__notifications('watcher_config').with( :transport_url => 'rabbit://rabbit_user:password@localhost:5673', :driver => 'messaging', - :topics => 'notifications' + :topics => 'notifications', + :retry => 10, ) end