Merge "Expose parameter to customize [oslo_messaging_notifications] retry"

This commit is contained in:
Zuul 2024-10-01 02:34:08 +00:00 committed by Gerrit Code Review
commit 28ae9b70c4
3 changed files with 26 additions and 12 deletions

View File

@ -147,19 +147,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
@ -171,7 +176,6 @@
# Daniel Pawlik <daniel.pawlik@corp.ovh.com>
#
class watcher (
Boolean $purge_config = false,
$package_ensure = 'present',
$rabbit_login_method = $facts['os_service_default'],
$rabbit_retry_interval = $facts['os_service_default'],
@ -203,6 +207,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
@ -259,6 +265,7 @@ class watcher (
transport_url => $notification_transport_url,
driver => $notification_driver,
topics => $notification_topics,
retry => $notification_retry,
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``watcher::notification_retry`` parameter has been added.

View File

@ -56,7 +56,8 @@ describe 'watcher' do
is_expected.to contain_oslo__messaging__notifications('watcher_config').with(
:transport_url => '<SERVICE DEFAULT>',
:driver => '<SERVICE DEFAULT>',
:topics => '<SERVICE DEFAULT>'
:topics => '<SERVICE DEFAULT>',
:retry => '<SERVICE DEFAULT>',
)
end
@ -90,6 +91,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
@ -122,7 +124,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