Merge "Add support for [DEFAULT] host option"

This commit is contained in:
Zuul
2025-08-25 19:48:20 +00:00
committed by Gerrit Code Review
3 changed files with 24 additions and 2 deletions

View File

@@ -5,8 +5,12 @@
# === Parameters:
#
# [*package_ensure*]
# (optional) Whether the watcher api package will be installed
# Defaults to 'present'
# (optional) Whether the watcher api package will be installed
# Defaults to 'present'
#
# [*host*]
# (optional) Name of this node.
# Defaults to $facts['os_service_default'].
#
# [*rabbit_login_method*]
# (optional) The RabbitMQ login method. (string value)
@@ -192,6 +196,7 @@
#
class watcher (
$package_ensure = 'present',
$host = $facts['os_service_default'],
$rabbit_login_method = $facts['os_service_default'],
$rabbit_retry_interval = $facts['os_service_default'],
$rabbit_retry_backoff = $facts['os_service_default'],
@@ -246,6 +251,10 @@ class watcher (
purge => $purge_config,
}
watcher_config {
'DEFAULT/host': value => $host;
}
oslo::messaging::rabbit { 'watcher_config':
amqp_durable_queues => $amqp_durable_queues,
kombu_ssl_version => $kombu_ssl_version,

View File

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

View File

@@ -26,6 +26,10 @@ describe 'watcher' do
it { is_expected.to contain_class('watcher::policy') }
it { is_expected.to contain_class('watcher::deps') }
it 'cofigures common options' do
is_expected.to contain_watcher_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
end
it 'configures messaging' do
is_expected.to contain_oslo__messaging__default('watcher_config').with(
:transport_url => '<SERVICE DEFAULT>',
@@ -75,6 +79,7 @@ describe 'watcher' do
context 'with overridden parameters' do
let :params do
{
:host => 'localhost',
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '120',
:control_exchange => 'watcher',
@@ -100,6 +105,10 @@ describe 'watcher' do
:notification_retry => 10,
}
end
it 'cofigures common options' do
is_expected.to contain_watcher_config('DEFAULT/host').with_value('localhost')
end
it 'configures messaging' do
is_expected.to contain_oslo__messaging__default('watcher_config').with(
:transport_url => 'rabbit://rabbit_user:password@localhost:5673',