From c9907ac8741a3e1d619d5425e8de8109e2b64de8 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Thu, 14 Jun 2018 15:56:34 +0200 Subject: [PATCH] Adds the configuration of bios interfaces It allows to set the enabled_bios_interfaces and default_bios_interface. Currently only no-bios interface is possible to add. Change-Id: I4960b55382b4ef60fefc147a2ae4fca3daa9432b --- manifests/drivers/interfaces.pp | 14 ++++++++++++++ .../notes/add-bios-interface-921d92b603dd287d.yaml | 5 +++++ spec/classes/ironic_drivers_interfaces_spec.rb | 7 ++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-bios-interface-921d92b603dd287d.yaml diff --git a/manifests/drivers/interfaces.pp b/manifests/drivers/interfaces.pp index 1a96bbcc..7762caac 100644 --- a/manifests/drivers/interfaces.pp +++ b/manifests/drivers/interfaces.pp @@ -14,6 +14,11 @@ # # === Parameters # +# [*default_bios_interface*] +# (optional) Default bios interface to be used for nodes that do not have +# bios_interface field set. +# Defaults to $::os_service_default +# # [*default_boot_interface*] # (optional) Default boot interface to be used for nodes that do not have # boot_interface field set. @@ -69,6 +74,11 @@ # vendor_interface field set. # Defaults to $::os_service_default # +# [*enabled_bios_interfaces*] +# (optional) Specify the list of bios interfaces to load during +# service initialization. +# Defaults to $::os_service_default +# # [*enabled_boot_interfaces*] # (optional) Specify the list of boot interfaces to load during # service initialization. @@ -125,6 +135,7 @@ # Defaults to $::os_service_default # class ironic::drivers::interfaces ( + $default_bios_interface = $::os_service_default, $default_boot_interface = $::os_service_default, $default_console_interface = $::os_service_default, $default_deploy_interface = $::os_service_default, @@ -136,6 +147,7 @@ class ironic::drivers::interfaces ( $default_rescue_interface = $::os_service_default, $default_storage_interface = $::os_service_default, $default_vendor_interface = $::os_service_default, + $enabled_bios_interfaces = $::os_service_default, $enabled_boot_interfaces = $::os_service_default, $enabled_console_interfaces = $::os_service_default, $enabled_deploy_interfaces = $::os_service_default, @@ -150,6 +162,8 @@ class ironic::drivers::interfaces ( ) { $interfaces = { + 'bios' => { 'enabled_list' => $enabled_bios_interfaces, + 'default' => $default_bios_interface }, 'boot' => { 'enabled_list' => $enabled_boot_interfaces, 'default' => $default_boot_interface }, 'console' => { 'enabled_list' => $enabled_console_interfaces, diff --git a/releasenotes/notes/add-bios-interface-921d92b603dd287d.yaml b/releasenotes/notes/add-bios-interface-921d92b603dd287d.yaml new file mode 100644 index 00000000..fdbc1984 --- /dev/null +++ b/releasenotes/notes/add-bios-interface-921d92b603dd287d.yaml @@ -0,0 +1,5 @@ +--- +features: + - It enables the configuration of enabled bios + interfaces and default bios interface. + diff --git a/spec/classes/ironic_drivers_interfaces_spec.rb b/spec/classes/ironic_drivers_interfaces_spec.rb index 24f8aec4..c5b49f4f 100644 --- a/spec/classes/ironic_drivers_interfaces_spec.rb +++ b/spec/classes/ironic_drivers_interfaces_spec.rb @@ -20,8 +20,10 @@ describe 'ironic::drivers::interfaces' do shared_examples_for 'ironic hardware interfaces' do context 'with default parameters' do + it { is_expected.to contain_ironic_config('DEFAULT/enabled_bios_interfaces').with_value('') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_boot_interfaces').with_value('') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_console_interfaces').with_value('') } + it { is_expected.to contain_ironic_config('DEFAULT/enabled_console_interfaces').with_value('') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_deploy_interfaces').with_value('') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_inspect_interfaces').with_value('') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_management_interfaces').with_value('') } @@ -35,7 +37,9 @@ describe 'ironic::drivers::interfaces' do context 'when overriding parameters' do let :params do - { :enabled_boot_interfaces => ['pxe'], + { + :enabled_bios_interfaces => ['no-bios'], + :enabled_boot_interfaces => ['pxe'], :enabled_console_interfaces => ['socat', 'shellinabox'], :enabled_deploy_interfaces => ['iscsi'], :enabled_inspect_interfaces => ['inspector'], @@ -48,6 +52,7 @@ describe 'ironic::drivers::interfaces' do :enabled_vendor_interfaces => ['no-vendor'] } end + it { is_expected.to contain_ironic_config('DEFAULT/enabled_bios_interfaces').with_value('no-bios') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_boot_interfaces').with_value('pxe') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_console_interfaces').with_value('socat,shellinabox') } it { is_expected.to contain_ironic_config('DEFAULT/enabled_deploy_interfaces').with_value('iscsi') }