Add support for [agent] command_wait_* options

... so that users can tune how asynchronous commands completion is
handled.

Change-Id: I9c84ea89ed6a1844b9facf95bd405ba51790401c
This commit is contained in:
Takashi Kajinami 2022-11-27 02:29:19 +09:00
parent 1929c31aac
commit 6fd748956f
3 changed files with 29 additions and 2 deletions

View File

@ -68,7 +68,16 @@
# (optional) Number of times to try connecting to the agent for a command.
# Defaults to $::os_service_default
#
# [*command_wait_attempts*]
# (optional) Number of attempts to check for asynchronous commands completion
# before timing out.
# Defaults to $::os_service_default
#
# [*command_wait_interval*]
# (optional) Number of seconds to wait for between checks for asynchronous
# commands completion.
# Defaults to $::os_service_default
#
class ironic::drivers::agent (
$stream_raw_images = $::os_service_default,
$image_download_source = $::os_service_default,
@ -81,6 +90,8 @@ class ironic::drivers::agent (
$deploy_logs_swift_days_to_expire = $::os_service_default,
$command_timeout = $::os_service_default,
$max_command_attempts = $::os_service_default,
$command_wait_attempts = $::os_service_default,
$command_wait_interval = $::os_service_default,
) {
include ironic::deps
@ -98,6 +109,8 @@ class ironic::drivers::agent (
'agent/deploy_logs_swift_days_to_expire': value => $deploy_logs_swift_days_to_expire;
'agent/command_timeout': value => $command_timeout;
'agent/max_command_attempts': value => $max_command_attempts;
'agent/command_wait_attempts': value => $command_wait_attempts;
'agent/command_wait_interval': value => $command_wait_interval;
}
}

View File

@ -0,0 +1,8 @@
---
features:
- |
The ``ironic::drivers::agent`` class now supports the following two new
parameters.
- ``command_wait_attempts``
- ``command_wait_interval``

View File

@ -38,6 +38,8 @@ describe 'ironic::drivers::agent' do
is_expected.to contain_ironic_config('agent/deploy_logs_swift_days_to_expire').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('agent/command_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('agent/max_command_attempts').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('agent/command_wait_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('agent/command_wait_attempts').with_value('<SERVICE DEFAULT>')
end
context 'when overriding parameters' do
@ -52,7 +54,9 @@ describe 'ironic::drivers::agent' do
:deploy_logs_swift_container => 'cont',
:deploy_logs_swift_days_to_expire => 5,
:command_timeout => 90,
:max_command_attempts => 5)
:max_command_attempts => 5,
:command_wait_interval => 2,
:command_wait_attempts => 100)
end
it 'should replace default parameter with new value' do
is_expected.to contain_ironic_config('agent/stream_raw_images').with_value(p[:stream_raw_images])
@ -66,6 +70,8 @@ describe 'ironic::drivers::agent' do
is_expected.to contain_ironic_config('agent/deploy_logs_swift_days_to_expire').with_value(p[:deploy_logs_swift_days_to_expire])
is_expected.to contain_ironic_config('agent/command_timeout').with_value(p[:command_timeout])
is_expected.to contain_ironic_config('agent/max_command_attempts').with_value(p[:max_command_attempts])
is_expected.to contain_ironic_config('agent/command_wait_interval').with_value(p[:command_wait_interval])
is_expected.to contain_ironic_config('agent/command_wait_attempts').with_value(p[:command_wait_attempts])
end
end