From f1aefe228afeab456cbe547e79217870ed4a321b Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 21 Dec 2021 11:04:50 +1300 Subject: [PATCH] Deprecate ironic::pxe::enable_ppc64le The boolean parameter ironic::pxe::enable_ppc64le is now undefined and setting it has no effect. Previously, setting it to true resulted in the creation of /tftpboot/ppc64le/. This directory is only required for the creation of inspector file /tftpboot/ppc64le/default. For this reason the directory creation is moved to inspector.pp and both are created when ironic::inspector::enable_ppc64le is set to true. Change-Id: I52e02f0ce21a88288cf97244dfb6f0d664b643dc --- manifests/inspector.pp | 7 +++++ manifests/pxe.pp | 30 ++++++++----------- ...e_pxe_enable_ppc64le-5c39e50a2bc5f619.yaml | 9 ++++++ spec/classes/ironic_inspector_spec.rb | 15 +++++++--- spec/classes/ironic_pxe_spec.rb | 16 ---------- 5 files changed, 40 insertions(+), 37 deletions(-) create mode 100644 releasenotes/notes/deprecate_pxe_enable_ppc64le-5c39e50a2bc5f619.yaml diff --git a/manifests/inspector.pp b/manifests/inspector.pp index db863f52..1de633dd 100644 --- a/manifests/inspector.pp +++ b/manifests/inspector.pp @@ -404,6 +404,13 @@ Use ironic::inspector::ironic::endpoint_override instead.') # NOTE: ppc64le hardware supports only tftp if $enable_ppc64le { + file { "${tftp_root_real}/ppc64le": + ensure => 'directory', + seltype => 'tftpdir_t', + owner => 'ironic-inspector', + group => 'ironic-inspector', + require => Anchor['ironic-inspector::config::begin'], + } file { "${tftp_root_real}/ppc64le/default": ensure => 'present', seltype => 'tftpdir_t', diff --git a/manifests/pxe.pp b/manifests/pxe.pp index 978c5367..f395c1c5 100644 --- a/manifests/pxe.pp +++ b/manifests/pxe.pp @@ -47,10 +47,6 @@ # (optional) The IP address TFTP server will listen on for TFTP. # Defaults to undef (listen on all ip addresses). # -# [*enable_ppc64le*] -# (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 @@ -68,6 +64,12 @@ # service facilitator. # Defaults to ironic::params::xinetd_available # +# DEPRECATED PARAMETERS +# +# [*enable_ppc64le*] +# (optional) Boolean value to dtermine if ppc64le support should be enabled +# Defaults to undef +# class ironic::pxe ( $package_ensure = 'present', $tftp_root = '/tftpboot', @@ -76,15 +78,20 @@ class ironic::pxe ( $syslinux_path = $::ironic::params::syslinux_path, $syslinux_files = $::ironic::params::syslinux_files, $tftp_bind_host = undef, - $enable_ppc64le = false, $ipxe_name_base = 'ipxe-snponly', $uefi_ipxe_bootfile_name = 'snponly.efi', - $tftp_use_xinetd = $::ironic::params::xinetd_available + $tftp_use_xinetd = $::ironic::params::xinetd_available, + # DEPRECATED PARAMETERS + $enable_ppc64le = undef ) inherits ironic::params { include ironic::deps include ironic::pxe::common + if $enable_ppc64le != undef { + warning('The ironic::pxe::enable_ppc64le parameter is deprecated and has no effect.') + } + $tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root) $http_root_real = pick($::ironic::pxe::common::http_root, $http_root) $http_port_real = pick($::ironic::pxe::common::http_port, $http_port) @@ -120,17 +127,6 @@ class ironic::pxe ( tag => 'ironic-tftp-file', } - if $enable_ppc64le { - file { "${tftp_root_real}/ppc64le": - ensure => 'directory', - seltype => 'tftpdir_t', - owner => 'ironic', - group => 'ironic', - require => Anchor['ironic::install::end'], - tag => 'ironic-tftp-file', - } - } - file { $http_root_real: ensure => 'directory', seltype => 'httpd_sys_content_t', diff --git a/releasenotes/notes/deprecate_pxe_enable_ppc64le-5c39e50a2bc5f619.yaml b/releasenotes/notes/deprecate_pxe_enable_ppc64le-5c39e50a2bc5f619.yaml new file mode 100644 index 00000000..7873733f --- /dev/null +++ b/releasenotes/notes/deprecate_pxe_enable_ppc64le-5c39e50a2bc5f619.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + The boolean parameter ``ironic::pxe::enable_ppc64le`` is now undefined and + setting it has no effect. Previously, setting it to true resulted in the + creation of ``/tftpboot/ppc64le/``. This directory is only required for the + creation of inspector file ``/tftpboot/ppc64le/default``. For this reason + the directory creation is moved to ``inspector.pp`` and both are created + when ``ironic::inspector::enable_ppc64le`` is set to ``true``. diff --git a/spec/classes/ironic_inspector_spec.rb b/spec/classes/ironic_inspector_spec.rb index 1330ef29..655f7190 100644 --- a/spec/classes/ironic_inspector_spec.rb +++ b/spec/classes/ironic_inspector_spec.rb @@ -344,8 +344,7 @@ describe 'ironic::inspector' do context 'when enabling ppc64le support' do let :pre_condition do - "class { 'ironic::inspector::authtoken': password => 'password', } - class { 'ironic::pxe': enable_ppc64le => true, }" + "class { 'ironic::inspector::authtoken': password => 'password', }" end before do @@ -358,6 +357,15 @@ describe 'ironic::inspector' do is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content( /dhcp-match=set:ppc64le,option:client-arch,14/) end + it 'should contain directory /tftpboot/ppc64le with selinux type tftpdir_t' do + is_expected.to contain_file('/tftpboot/ppc64le').with( + 'owner' => 'ironic-inspector', + 'group' => 'ironic-inspector', + 'require' => 'Anchor[ironic-inspector::config::begin]', + 'ensure' => 'directory', + 'seltype' => 'tftpdir_t', + ) + end it 'should contain file /tftpboot/ppc64le/default' do is_expected.to contain_file('/tftpboot/ppc64le/default').with( 'owner' => 'ironic-inspector', @@ -375,8 +383,7 @@ describe 'ironic::inspector' do context 'when enabling ppc64le support with http default transport' do let :pre_condition do - "class { 'ironic::inspector::authtoken': password => 'password', } - class { 'ironic::pxe': enable_ppc64le => true, }" + "class { 'ironic::inspector::authtoken': password => 'password', }" end before do diff --git a/spec/classes/ironic_pxe_spec.rb b/spec/classes/ironic_pxe_spec.rb index 35987738..f44cb8bc 100644 --- a/spec/classes/ironic_pxe_spec.rb +++ b/spec/classes/ironic_pxe_spec.rb @@ -156,22 +156,6 @@ describe 'ironic::pxe' do end end - context 'when enabling ppc64le support' do - before :each do - params.merge!( - :enable_ppc64le => true, - ) - end - it 'should contain directory /tftpboot/ppc64le with selinux type tftpdir_t' do - is_expected.to contain_file('/tftpboot/ppc64le').with( - 'owner' => 'ironic', - 'group' => 'ironic', - 'require' => 'Anchor[ironic::install::end]', - 'ensure' => 'directory', - 'seltype' => 'tftpdir_t', - ) - end - end end shared_examples_for 'ironic pxe in RedHat' do