From 4de96545792b6ed6375ca7ce07b58f617a0f0e0b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 26 Oct 2020 20:54:09 +0900 Subject: [PATCH] Add support for the firmware update feature in redfish driver This patch introduces parameters related to the firmware update, which was added to Ironic during Victoria cycle[1]. [1] f0e0ef634e55f46eda4942e9665d35c70d305365 Change-Id: If95ff0d0422142c3ed74eba4110969479a51139d --- manifests/drivers/redfish.pp | 52 ++++++++++++------- ...fish-firmware-update-dbba5a792ebcdfc9.yaml | 9 ++++ spec/classes/ironic_drivers_redfish_spec.rb | 24 +++++---- 3 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 releasenotes/notes/redfish-firmware-update-dbba5a792ebcdfc9.yaml diff --git a/manifests/drivers/redfish.pp b/manifests/drivers/redfish.pp index 06e89618..42f8fa45 100644 --- a/manifests/drivers/redfish.pp +++ b/manifests/drivers/redfish.pp @@ -57,32 +57,46 @@ # permission representation of file access permissions. # Defaults to $::os_service_default. # +# [*firmware_update_status_interval*] +# (optional) Number of seconds to wait between checking for completed +# firmware update tasks. +# Defaults to $::os_service_default +# +# [*firmware_update_fail_interval*] +# (optional) Number of seconds to wait between checking for failed firmware +# update tasks. +# Defaults to $::os_service_default +# class ironic::drivers::redfish ( - $package_ensure = 'present', - $connection_attempts = $::os_service_default, - $connection_retry_interval = $::os_service_default, - $connection_cache_size = $::os_service_default, - $auth_type = $::os_service_default, - $use_swift = $::os_service_default, - $swift_container = $::os_service_default, - $swift_object_expiry_timeout = $::os_service_default, - $kernel_append_params = $::os_service_default, - $file_permission = $::os_service_default, + $package_ensure = 'present', + $connection_attempts = $::os_service_default, + $connection_retry_interval = $::os_service_default, + $connection_cache_size = $::os_service_default, + $auth_type = $::os_service_default, + $use_swift = $::os_service_default, + $swift_container = $::os_service_default, + $swift_object_expiry_timeout = $::os_service_default, + $kernel_append_params = $::os_service_default, + $file_permission = $::os_service_default, + $firmware_update_status_interval = $::os_service_default, + $firmware_update_fail_interval = $::os_service_default, ) { include ironic::deps include ironic::params ironic_config { - 'redfish/connection_attempts': value => $connection_attempts; - 'redfish/connection_retry_interval': value => $connection_retry_interval; - 'redfish/connection_cache_size': value => $connection_cache_size; - 'redfish/auth_type': value => $auth_type; - 'redfish/use_swift': value => $use_swift; - 'redfish/swift_container': value => $swift_container; - 'redfish/swift_object_expiry_timeout': value => $swift_object_expiry_timeout; - 'redfish/kernel_append_params': value => $kernel_append_params; - 'redfish/file_permission': value => $file_permission; + 'redfish/connection_attempts': value => $connection_attempts; + 'redfish/connection_retry_interval': value => $connection_retry_interval; + 'redfish/connection_cache_size': value => $connection_cache_size; + 'redfish/auth_type': value => $auth_type; + 'redfish/use_swift': value => $use_swift; + 'redfish/swift_container': value => $swift_container; + 'redfish/swift_object_expiry_timeout': value => $swift_object_expiry_timeout; + 'redfish/kernel_append_params': value => $kernel_append_params; + 'redfish/file_permission': value => $file_permission; + 'redfish/firmware_update_status_interval': value => $firmware_update_status_interval; + 'redfish/firmware_update_fail_interval': value => $firmware_update_fail_interval; } ensure_packages('python-sushy', diff --git a/releasenotes/notes/redfish-firmware-update-dbba5a792ebcdfc9.yaml b/releasenotes/notes/redfish-firmware-update-dbba5a792ebcdfc9.yaml new file mode 100644 index 00000000..f0200c6f --- /dev/null +++ b/releasenotes/notes/redfish-firmware-update-dbba5a792ebcdfc9.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + The ``ironic::driver::redfish`` class now supports the following two + parameters to set the polling intervals for the firmware update feature in + redfish driver. + + - ``firmware_update_status_interval`` + - ``firmware_update_fail_interval`` diff --git a/spec/classes/ironic_drivers_redfish_spec.rb b/spec/classes/ironic_drivers_redfish_spec.rb index 816245b9..f4263b02 100644 --- a/spec/classes/ironic_drivers_redfish_spec.rb +++ b/spec/classes/ironic_drivers_redfish_spec.rb @@ -36,6 +36,8 @@ describe 'ironic::drivers::redfish' do is_expected.to contain_ironic_config('redfish/swift_object_expiry_timeout').with_value('') is_expected.to contain_ironic_config('redfish/kernel_append_params').with_value('') is_expected.to contain_ironic_config('redfish/file_permission').with_value('') + is_expected.to contain_ironic_config('redfish/firmware_update_status_interval').with_value('') + is_expected.to contain_ironic_config('redfish/firmware_update_fail_interval').with_value('') end it 'installs sushy package' do @@ -49,15 +51,17 @@ describe 'ironic::drivers::redfish' do context 'when overriding parameters' do before do params.merge!( - :connection_attempts => 10, - :connection_retry_interval => 1, - :connection_cache_size => 100, - :auth_type => 'auto', - :use_swift => true, - :swift_container => 'ironic_redfish_container', - :swift_object_expiry_timeout => 900, - :kernel_append_params => 'nofb nomodeset vga=normal', - :file_permission => '0o644' + :connection_attempts => 10, + :connection_retry_interval => 1, + :connection_cache_size => 100, + :auth_type => 'auto', + :use_swift => true, + :swift_container => 'ironic_redfish_container', + :swift_object_expiry_timeout => 900, + :kernel_append_params => 'nofb nomodeset vga=normal', + :file_permission => '0o644', + :firmware_update_status_interval => 60, + :firmware_update_fail_interval => 60, ) end @@ -71,6 +75,8 @@ describe 'ironic::drivers::redfish' do is_expected.to contain_ironic_config('redfish/swift_object_expiry_timeout').with_value(900) is_expected.to contain_ironic_config('redfish/kernel_append_params').with_value('nofb nomodeset vga=normal') is_expected.to contain_ironic_config('redfish/file_permission').with_value('0o644') + is_expected.to contain_ironic_config('redfish/firmware_update_status_interval').with_value(60) + is_expected.to contain_ironic_config('redfish/firmware_update_fail_interval').with_value(60) end end