From 6fd748956f0d44584cc38df1886ca7b3b9e96fdd Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 27 Nov 2022 02:29:19 +0900 Subject: [PATCH] Add support for [agent] command_wait_* options ... so that users can tune how asynchronous commands completion is handled. Change-Id: I9c84ea89ed6a1844b9facf95bd405ba51790401c --- manifests/drivers/agent.pp | 15 ++++++++++++++- .../agent-command_wait_opts-8cf9e6f81ba70064.yaml | 8 ++++++++ spec/classes/ironic_drivers_agent_spec.rb | 8 +++++++- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/agent-command_wait_opts-8cf9e6f81ba70064.yaml diff --git a/manifests/drivers/agent.pp b/manifests/drivers/agent.pp index fbaf49aa..9be052a0 100644 --- a/manifests/drivers/agent.pp +++ b/manifests/drivers/agent.pp @@ -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; } } diff --git a/releasenotes/notes/agent-command_wait_opts-8cf9e6f81ba70064.yaml b/releasenotes/notes/agent-command_wait_opts-8cf9e6f81ba70064.yaml new file mode 100644 index 00000000..2b62f43d --- /dev/null +++ b/releasenotes/notes/agent-command_wait_opts-8cf9e6f81ba70064.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The ``ironic::drivers::agent`` class now supports the following two new + parameters. + + - ``command_wait_attempts`` + - ``command_wait_interval`` diff --git a/spec/classes/ironic_drivers_agent_spec.rb b/spec/classes/ironic_drivers_agent_spec.rb index ca11e55d..f1519478 100644 --- a/spec/classes/ironic_drivers_agent_spec.rb +++ b/spec/classes/ironic_drivers_agent_spec.rb @@ -38,6 +38,8 @@ describe 'ironic::drivers::agent' do is_expected.to contain_ironic_config('agent/deploy_logs_swift_days_to_expire').with_value('') is_expected.to contain_ironic_config('agent/command_timeout').with_value('') is_expected.to contain_ironic_config('agent/max_command_attempts').with_value('') + is_expected.to contain_ironic_config('agent/command_wait_interval').with_value('') + is_expected.to contain_ironic_config('agent/command_wait_attempts').with_value('') 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