Allow alternative source files for /tftpboot/ipxe.efi

ipxe-bootimgs will soon include the ipxe efi variant
ipxe-snponly.efi which has no networking stack, relying instead
on the UEFI networking stack. This image is required in some UEFI
environments instead of the full ipxe.efi, so there needs to be
a mechanism for serving it by default.

This change makes this possible by setting the puppet parameter
ironic::pxe::ipxe_name_base to ipxe-snponly.

Change-Id: I3a0e85ce6d83001833c829f484baf181a677a5d9
(cherry picked from commit ca47ba7c7f)
This commit is contained in:
Steve Baker 2020-04-21 13:59:07 +12:00
parent f3eba3423a
commit 74e8eb2304
3 changed files with 19 additions and 5 deletions

View File

@ -51,6 +51,12 @@
# (optional) Boolean value to dtermine if ppc64le support should be enabled # (optional) Boolean value to dtermine if ppc64le support should be enabled
# Defaults to false (no ppc64le support) # Defaults to false (no ppc64le support)
# #
# [*ipxe_name_base*]
# (optional) Beginning of the source file name which is copied to
# $tftproot/ipxe.efi. Setting this to 'ipxe-snponly' on CentOS7 would result
# in the source file being /usr/share/ipxe/ipxe-snponly.efi
# Defaults to 'ipxe'
#
class ironic::pxe ( class ironic::pxe (
$package_ensure = 'present', $package_ensure = 'present',
$tftp_root = '/tftpboot', $tftp_root = '/tftpboot',
@ -60,6 +66,7 @@ class ironic::pxe (
$syslinux_files = $::ironic::params::syslinux_files, $syslinux_files = $::ironic::params::syslinux_files,
$tftp_bind_host = undef, $tftp_bind_host = undef,
$enable_ppc64le = false, $enable_ppc64le = false,
$ipxe_name_base = 'ipxe',
) inherits ::ironic::params { ) inherits ::ironic::params {
include ::ironic::deps include ::ironic::deps
@ -158,7 +165,7 @@ class ironic::pxe (
}) })
file { "${tftp_root_real}/undionly.kpxe": file { "${tftp_root_real}/undionly.kpxe":
ensure => 'present', ensure => 'file',
seltype => 'tftpdir_t', seltype => 'tftpdir_t',
owner => 'ironic', owner => 'ironic',
group => 'ironic', group => 'ironic',
@ -169,12 +176,12 @@ class ironic::pxe (
} }
file { "${tftp_root_real}/ipxe.efi": file { "${tftp_root_real}/ipxe.efi":
ensure => 'present', ensure => 'file',
seltype => 'tftpdir_t', seltype => 'tftpdir_t',
owner => 'ironic', owner => 'ironic',
group => 'ironic', group => 'ironic',
mode => '0744', mode => '0744',
source => "${::ironic::params::ipxe_rom_dir}/ipxe.efi", source => "${::ironic::params::ipxe_rom_dir}/${ipxe_name_base}.efi",
backup => false, backup => false,
require => Anchor['ironic-inspector::install::end'], require => Anchor['ironic-inspector::install::end'],
} }

View File

@ -0,0 +1,7 @@
---
features:
- |
The parameter ironic::pxe::ipxe_name_base has been added, which allows
alternative ipxe files to be copied to /tftpboot/ipxe.efi. For example,
setting this to 'ipxe-snponly' on CentOS8 would result in the source file
being /usr/share/ipxe/ipxe-snponly-x86_64.efi.

View File

@ -106,7 +106,7 @@ describe 'ironic::pxe' do
'group' => 'ironic', 'group' => 'ironic',
'require' => 'Anchor[ironic-inspector::install::end]', 'require' => 'Anchor[ironic-inspector::install::end]',
'seltype' => 'tftpdir_t', 'seltype' => 'tftpdir_t',
'ensure' => 'present', 'ensure' => 'file',
'backup' => false, 'backup' => false,
) )
end end
@ -116,7 +116,7 @@ describe 'ironic::pxe' do
'group' => 'ironic', 'group' => 'ironic',
'require' => 'Anchor[ironic-inspector::install::end]', 'require' => 'Anchor[ironic-inspector::install::end]',
'seltype' => 'tftpdir_t', 'seltype' => 'tftpdir_t',
'ensure' => 'present', 'ensure' => 'file',
'backup' => false, 'backup' => false,
) )
end end