Support ironic::conductor::conductor_group parameter

Change-Id: Ia74085a7906c1c36afafb91d285e47f53c933e45
This commit is contained in:
Dmitry Tantsur 2018-07-30 13:52:47 +02:00
parent 66abab1969
commit bca7eb5650
3 changed files with 15 additions and 0 deletions

View File

@ -152,6 +152,11 @@
# synchronization failure.
# Defaults to $::os_service_default
#
# [*conductor_group*]
# (optional) Name of the conductor group to join. This conductor will only
# manage nodes with a matching "conductor_group" field set on the node.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*enabled_drivers*]
@ -186,6 +191,7 @@ class ironic::conductor (
$sync_power_state_interval = $::os_service_default,
$power_state_sync_max_retries = $::os_service_default,
$power_failure_recovery_interval = $::os_service_default,
$conductor_group = $::os_service_default,
$enabled_drivers = undef,
) {
@ -270,6 +276,7 @@ class ironic::conductor (
'conductor/sync_power_state_interval': value => $sync_power_state_interval;
'conductor/power_state_sync_max_retries': value => $power_state_sync_max_retries;
'conductor/power_failure_recovery_interval': value => $power_failure_recovery_interval;
'conductor/conductor_group': value => $conductor_group;
}
if $cleaning_network_name {

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds ``ironic::conductor::conductor_group`` parameter to assign a group
to the conductor.

View File

@ -83,6 +83,7 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('conductor/sync_power_state_interval').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/power_state_sync_max_retries').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/power_failure_recovery_interval').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/conductor_group').with(:value => '<SERVICE DEFAULT>')
end
context 'when overriding parameters' do
@ -107,6 +108,7 @@ describe 'ironic::conductor' do
:sync_power_state_interval => 120,
:power_state_sync_max_retries => 5,
:power_failure_recovery_interval => 120,
:conductor_group => 'in-the-closet-to-the-left',
)
end
it 'should replace default parameter with new value' do
@ -130,6 +132,7 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('conductor/sync_power_state_interval').with_value(p[:sync_power_state_interval])
is_expected.to contain_ironic_config('conductor/power_state_sync_max_retries').with_value(p[:power_state_sync_max_retries])
is_expected.to contain_ironic_config('conductor/power_failure_recovery_interval').with_value(p[:power_failure_recovery_interval])
is_expected.to contain_ironic_config('conductor/conductor_group').with_value(p[:conductor_group])
end
end