[pxe]/ip_version param in ironic::drivers::pxe

Add the ip_version parameter in the pxe class so that
the IP version that will be used for PXE booting can
be configured.

Closes-Bug: #1845746
Change-Id: Ib29adccc8378bd3e2a46b7d2ca3cfacba55e7674
This commit is contained in:
Harald Jensås 2019-09-28 01:34:17 +02:00
parent b0c9b9ffae
commit 0e8a483e35
3 changed files with 15 additions and 0 deletions

View File

@ -89,6 +89,10 @@
# (optional) How often (in seconds) to check for PXE boot status.
# Defaults to $::os_service_default.
#
# [*ip_version*]
# (optional) The IP version that will be used for PXE booting.
# Defaults to $::os_service_default.
#
class ironic::drivers::pxe (
$ipxe_enabled = false,
$pxe_append_params = $::os_service_default,
@ -105,6 +109,7 @@ class ironic::drivers::pxe (
$enable_ppc64le = false,
$boot_retry_timeout = $::os_service_default,
$boot_retry_check_interval = $::os_service_default,
$ip_version = $::os_service_default,
) {
include ::ironic::deps
@ -136,6 +141,7 @@ class ironic::drivers::pxe (
'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/ip_version': value => $ip_version;
}
if $enable_ppc64le {

View File

@ -0,0 +1,7 @@
---
features:
- |
New parameter added for ``[pxe]/ip_version`` in ``ironic::drivers::pxe``.
It is used to set the IP version that will be used for PXE booting.
Bug: `1845746 <https://bugs.launchpad.net/puppet-ironic/+bug/1845746>`_.

View File

@ -105,6 +105,7 @@ describe 'ironic::drivers::pxe' do
:pxe_bootfile_name => 'bootx64',
:boot_retry_timeout => 600,
:boot_retry_check_interval => 120,
:ip_version => 6,
)
end
@ -123,6 +124,7 @@ 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/ip_version').with_value(p[:ip_version])
end
end