Merge "inspector: Add support for [DEFAULT] host"

This commit is contained in:
Zuul
2025-08-25 19:47:14 +00:00
committed by Gerrit Code Review
3 changed files with 13 additions and 0 deletions

View File

@@ -29,6 +29,10 @@
# (optional) Define if the service must be enabled or not
# Defaults to true
#
# [*host*]
# (optional) Name of this node.
# Defaults to $facts['os_service_default'].
#
# [*listen_address*]
# (optional) The listen IP for the Ironic-inspector API server.
# Should be an valid IP address
@@ -341,6 +345,7 @@ class ironic::inspector (
$package_ensure = 'present',
Boolean $manage_service = true,
Boolean $enabled = true,
$host = $facts['os_service_default'],
$listen_address = $facts['os_service_default'],
Enum['http', 'tftp'] $pxe_transfer_protocol = 'tftp',
Boolean $dhcp_debug = false,
@@ -493,6 +498,7 @@ class ironic::inspector (
}
ironic_inspector_config {
'DEFAULT/host': value => $host;
'DEFAULT/listen_address': value => $listen_address;
'DEFAULT/auth_strategy': value => $auth_strategy;
'DEFAULT/timeout': value => $timeout;

View File

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

View File

@@ -108,6 +108,7 @@ describe 'ironic::inspector' do
end
it 'configures inspector.conf' do
is_expected.to contain_ironic_inspector_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/listen_address').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/auth_strategy').with_value(p[:auth_strategy])
is_expected.to contain_ironic_inspector_config('DEFAULT/timeout').with_value('<SERVICE DEFAULT>')
@@ -224,6 +225,7 @@ describe 'ironic::inspector' do
before :each do
params.merge!(
:dhcp_debug => true,
:host => 'localhost',
:listen_address => '127.0.0.1',
:api_max_limit => 100,
:pxe_transfer_protocol => 'http',
@@ -273,6 +275,7 @@ describe 'ironic::inspector' do
)
end
it 'should replace default parameter with new value' do
is_expected.to contain_ironic_inspector_config('DEFAULT/host').with_value(p[:host])
is_expected.to contain_ironic_inspector_config('DEFAULT/listen_address').with_value(p[:listen_address])
is_expected.to contain_ironic_inspector_config('DEFAULT/api_max_limit').with_value(100)
is_expected.to contain_ironic_inspector_config('capabilities/boot_mode').with_value(p[:detect_boot_mode])