From ca47ba7c7f96172723c2a7d00a469986b302694f Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 21 Apr 2020 13:59:07 +1200 Subject: [PATCH] Allow alternative source files for /tftpboot/ipxe.efi ipxe-bootimgs will soon include the ipxe efi variant ipxe-snponly-x86_64.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-x86_64.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 --- manifests/pxe.pp | 13 ++++++++++--- .../notes/ipxe_name_base-91f5a571210f171c.yaml | 7 +++++++ spec/classes/ironic_pxe_spec.rb | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/ipxe_name_base-91f5a571210f171c.yaml diff --git a/manifests/pxe.pp b/manifests/pxe.pp index 19ab5cc2..b83347be 100644 --- a/manifests/pxe.pp +++ b/manifests/pxe.pp @@ -51,6 +51,12 @@ # (optional) Boolean value to dtermine if ppc64le support should be enabled # 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 CentOS8 would result +# in the source file being /usr/share/ipxe/ipxe-snponly-x86_64.efi +# Defaults to 'ipxe' +# class ironic::pxe ( $package_ensure = 'present', $tftp_root = '/tftpboot', @@ -60,6 +66,7 @@ class ironic::pxe ( $syslinux_files = $::ironic::params::syslinux_files, $tftp_bind_host = undef, $enable_ppc64le = false, + $ipxe_name_base = 'ipxe', ) inherits ::ironic::params { include ironic::deps @@ -165,7 +172,7 @@ class ironic::pxe ( }) file { "${tftp_root_real}/undionly.kpxe": - ensure => 'present', + ensure => 'file', seltype => 'tftpdir_t', owner => 'ironic', group => 'ironic', @@ -176,12 +183,12 @@ class ironic::pxe ( } file { "${tftp_root_real}/ipxe.efi": - ensure => 'present', + ensure => 'file', seltype => 'tftpdir_t', owner => 'ironic', group => 'ironic', mode => '0744', - source => "${::ironic::params::ipxe_rom_dir}/ipxe${arch}.efi", + source => "${::ironic::params::ipxe_rom_dir}/${ipxe_name_base}${arch}.efi", backup => false, require => Anchor['ironic-inspector::install::end'], } diff --git a/releasenotes/notes/ipxe_name_base-91f5a571210f171c.yaml b/releasenotes/notes/ipxe_name_base-91f5a571210f171c.yaml new file mode 100644 index 00000000..f884e210 --- /dev/null +++ b/releasenotes/notes/ipxe_name_base-91f5a571210f171c.yaml @@ -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. \ No newline at end of file diff --git a/spec/classes/ironic_pxe_spec.rb b/spec/classes/ironic_pxe_spec.rb index c16b86fb..b39d3c37 100644 --- a/spec/classes/ironic_pxe_spec.rb +++ b/spec/classes/ironic_pxe_spec.rb @@ -106,7 +106,7 @@ describe 'ironic::pxe' do 'group' => 'ironic', 'require' => 'Anchor[ironic-inspector::install::end]', 'seltype' => 'tftpdir_t', - 'ensure' => 'present', + 'ensure' => 'file', 'backup' => false, ) end @@ -116,7 +116,7 @@ describe 'ironic::pxe' do 'group' => 'ironic', 'require' => 'Anchor[ironic-inspector::install::end]', 'seltype' => 'tftpdir_t', - 'ensure' => 'present', + 'ensure' => 'file', 'backup' => false, ) end