Add support for [DEFAULT] host option

Change-Id: I5233c4dab70ee84977d0548bc8335c7f5a072d70
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-08-24 15:51:52 +09:00
parent 892509807b
commit ebbbf82376
3 changed files with 19 additions and 3 deletions

View File

@@ -8,6 +8,10 @@
# (optional) The state of aodh packages
# Defaults to 'present'
#
# [*host*]
# (optional) Name of this node.
# Defaults to $facts['os_service_default'].
#
# [*default_transport_url*]
# (optional) A URL representing the messaging driver to use and its full
# configuration. Transport URLs take the form:
@@ -184,6 +188,7 @@
#
class octavia (
$package_ensure = 'present',
$host = $facts['os_service_default'],
$default_transport_url = $facts['os_service_default'],
$rpc_response_timeout = $facts['os_service_default'],
$control_exchange = $facts['os_service_default'],
@@ -233,6 +238,10 @@ class octavia (
purge => $purge_config,
}
octavia_config {
'DEFAULT/host' : value => $host;
}
oslo::messaging::rabbit { 'octavia_config':
rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,

View File

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

View File

@@ -67,15 +67,17 @@ describe 'octavia' do
:retry => '<SERVICE DEFAULT>',
)
end
end
it 'has default RPC topic' do
is_expected.to contain_octavia_config('oslo_messaging/topic').with_value('octavia-rpc')
it 'configures defaults' do
is_expected.to contain_octavia_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging/topic').with_value('octavia-rpc')
end
end
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 => 'octavia',
@@ -150,6 +152,7 @@ describe 'octavia' do
end
it 'configures various things' do
is_expected.to contain_octavia_config('DEFAULT/host').with_value('localhost')
is_expected.to contain_octavia_config('oslo_messaging/topic').with_value('oct-rpc')
end
end