Merge "Rename pxe_append_params"

This commit is contained in:
Zuul 2021-09-27 13:31:44 +00:00 committed by Gerrit Code Review
commit affcb980a9
3 changed files with 26 additions and 6 deletions

View File

@ -19,7 +19,7 @@
#
# === Parameters
#
# [*pxe_append_params*]
# [*kernel_append_params*]
# (optional) Additional append parameters for baremetal PXE boot.
# Should be valid pxe parameters
# Defaults to $::os_service_default.
@ -117,8 +117,13 @@
# release.
# Defaults to $::os_service_default.
#
# [*pxe_append_params*]
# (optional) Additional append parameters for baremetal PXE boot.
# Should be valid pxe parameters
# Defaults to undef.
#
class ironic::drivers::pxe (
$pxe_append_params = $::os_service_default,
$kernel_append_params = $::os_service_default,
$pxe_bootfile_name = $::os_service_default,
$pxe_config_template = $::os_service_default,
$ipxe_bootfile_name = $::os_service_default,
@ -138,6 +143,7 @@ class ironic::drivers::pxe (
# DEPRECATED PARAMETERS
$ipxe_enabled = undef,
$ip_version = undef,
$pxe_append_params = undef,
) {
include ironic::deps
@ -154,9 +160,18 @@ class ironic::drivers::pxe (
}
$ip_version_real = pick($ip_version, $::os_service_default)
if $pxe_append_params != undef {
warning('The ironic::drivers::pxe::pxe_append_params parameter is deprecated. \
Use the kernel_append_params parameter instead')
}
$kernel_append_params_real = pick($pxe_append_params, kernel_append_params)
ironic_config {
'pxe/pxe_append_params': ensure => absent
}
# Configure ironic.conf
ironic_config {
'pxe/pxe_append_params': value => $pxe_append_params;
'pxe/kernel_append_params': value => $kernel_append_params;
'pxe/pxe_bootfile_name': value => $pxe_bootfile_name;
'pxe/pxe_config_template': value => $pxe_config_template;
'pxe/ipxe_bootfile_name': value => $ipxe_bootfile_name;

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``ironic::drivers::pxe::pxe_append_params`` parameter has been
deprecated in favor of the new ``kernel_append_params`` parameter.

View File

@ -37,7 +37,7 @@ describe 'ironic::drivers::pxe' do
end
it 'configures ironic.conf' do
is_expected.to contain_ironic_config('pxe/pxe_append_params').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/kernel_append_params').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/pxe_bootfile_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/pxe_config_template').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('pxe/ipxe_bootfile_name').with_value('<SERVICE DEFAULT>')
@ -69,7 +69,7 @@ describe 'ironic::drivers::pxe' do
context 'when overriding parameters' do
before do
params.merge!(
:pxe_append_params => 'foo',
:kernel_append_params => 'foo',
:pxe_config_template => 'bar',
:tftp_server => '192.168.0.1',
:tftp_root => '/mnt/ftp',
@ -88,7 +88,7 @@ describe 'ironic::drivers::pxe' do
end
it 'should replace default parameter with new value' do
is_expected.to contain_ironic_config('pxe/pxe_append_params').with_value(p[:pxe_append_params])
is_expected.to contain_ironic_config('pxe/kernel_append_params').with_value(p[:kernel_append_params])
is_expected.to contain_ironic_config('pxe/pxe_config_template').with_value(p[:pxe_config_template])
is_expected.to contain_ironic_config('pxe/tftp_server').with_value(p[:tftp_server])
is_expected.to contain_ironic_config('pxe/tftp_root').with_value(p[:tftp_root])