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
This commit is contained in:
Yolanda Robla 2018-06-14 15:56:34 +02:00
parent 2ad9190159
commit c9907ac874
3 changed files with 25 additions and 1 deletions

View File

@ -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,

View File

@ -0,0 +1,5 @@
---
features:
- It enables the configuration of enabled bios
interfaces and default bios interface.

View File

@ -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('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_boot_interfaces').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_console_interfaces').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_console_interfaces').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_deploy_interfaces').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_inspect_interfaces').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('DEFAULT/enabled_management_interfaces').with_value('<SERVICE DEFAULT>') }
@ -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') }