Add support for [pxe] loader_file_paths and dir/file_permission

Depends-on: https://review.opendev.org/806815
Change-Id: Ic3e99ed7934c869f6fe41d08edab4cc332ed40c5
This commit is contained in:
Takashi Kajinami 2021-10-30 09:22:35 +09:00
parent 889fc86298
commit 75e3171ed3
3 changed files with 42 additions and 0 deletions

View File

@ -102,6 +102,21 @@
# (optional) How often (in seconds) to check for PXE boot status.
# Defaults to $::os_service_default.
#
# [*dir_permission*]
# (optional) THe permission that will be applied to the TFTP folders upon
# creation.
# Defaults to $::os_service_default.
#
# [*file_permission*]
# (optional) The permission which is used on files created as part of
# configuration and setup of file assets for PXE based operations.
# Defaults to $::os_service_default.
#
# [*loader_file_paths*]
# (optional) Dictionary describing the bootloaders to load into conductor
# PXE/iXPE boot folders values from the host operating system.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*ipxe_enabled*]
@ -140,6 +155,9 @@ class ironic::drivers::pxe (
$enable_ppc64le = false,
$boot_retry_timeout = $::os_service_default,
$boot_retry_check_interval = $::os_service_default,
$dir_permission = $::os_service_default,
$file_permission = $::os_service_default,
$loader_file_paths = $::os_service_default,
# DEPRECATED PARAMETERS
$ipxe_enabled = undef,
$ip_version = undef,
@ -187,6 +205,9 @@ Use the kernel_append_params parameter instead')
'pxe/ipxe_timeout': value => $ipxe_timeout_real;
'pxe/boot_retry_timeout': value => $boot_retry_timeout;
'pxe/boot_retry_check_interval': value => $boot_retry_check_interval;
'pxe/dir_permission': value => $dir_permission;
'pxe/file_permission': value => $file_permission;
'pxe/loader_file_paths': value => join(any2array($loader_file_paths), ',');
'pxe/ipxe_enabled': ensure => absent;
'pxe/ip_version': value => $ip_version_real;
}

View File

@ -0,0 +1,10 @@
---
features:
- |
The ``ironic::driver::pxe`` class supports the following two new
parameters, to manage the corresponding parameters in the ``[pxe]``
section.
- ``dir_permission``
- ``file_permission``
- ``loader_file_paths``

View File

@ -50,6 +50,9 @@ describe 'ironic::drivers::pxe' do
is_expected.to contain_ironic_config('pxe/uefi_pxe_bootfile_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/uefi_pxe_config_template').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/uefi_ipxe_bootfile_name').with_value('snponly.efi')
is_expected.to contain_ironic_config('pxe/dir_permission').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/file_permission').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/loader_file_paths').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/ipxe_enabled').with_ensure('absent')
end
@ -83,6 +86,10 @@ describe 'ironic::drivers::pxe' do
:pxe_bootfile_name => 'bootx64',
:boot_retry_timeout => 600,
:boot_retry_check_interval => 120,
:dir_permission => '0o755',
:file_permission => '0o644',
:loader_file_paths => ['ipxe.efi:/usr/share/ipxe/ipxe-snponly-x86_64.efi',
'undionly.kpxe:/usr/share/ipxe/undionly.kpxe'],
:ip_version => 6,
)
end
@ -102,6 +109,10 @@ describe 'ironic::drivers::pxe' do
is_expected.to contain_ironic_config('pxe/pxe_bootfile_name').with_value(p[:pxe_bootfile_name])
is_expected.to contain_ironic_config('pxe/boot_retry_timeout').with_value(p[:boot_retry_timeout])
is_expected.to contain_ironic_config('pxe/boot_retry_check_interval').with_value(p[:boot_retry_check_interval])
is_expected.to contain_ironic_config('pxe/dir_permission').with_value('0o755')
is_expected.to contain_ironic_config('pxe/file_permission').with_value('0o644')
is_expected.to contain_ironic_config('pxe/loader_file_paths')
.with_value('ipxe.efi:/usr/share/ipxe/ipxe-snponly-x86_64.efi,undionly.kpxe:/usr/share/ipxe/undionly.kpxe')
is_expected.to contain_ironic_config('pxe/ip_version').with_value(p[:ip_version])
end
end