Add uefi_pxe_bootfile_name parameter

Add uefi_pxe_bootfile_name parameter with the default value from Ironic
master.

Change-Id: Ia7d51e08778c9d1083a40dbc252000689f3bba49
This commit is contained in:
Emilien Macchi 2015-12-17 10:39:35 -05:00
parent 2c83972567
commit 12e15ba21a
2 changed files with 37 additions and 27 deletions

View File

@ -69,30 +69,36 @@
# Should be an valid directory
# Defaults to '/var/lib/ironic/master_images'.
#
# [*uefi_pxe_bootfile_name*]
# (optional) Bootfile DHCP parameter for UEFI boot mode.
# Defaults to 'elilo.efi'.
#
class ironic::drivers::pxe (
$deploy_kernel = undef,
$deploy_ramdisk = undef,
$pxe_append_params = 'nofb nomodeset vga=normal',
$pxe_config_template = '$pybasedir/drivers/modules/pxe_config.template',
$pxe_deploy_timeout = '0',
$tftp_server = '$my_ip',
$tftp_root = '/tftpboot',
$images_path = '/var/lib/ironic/images/',
$tftp_master_path = '/tftpboot/master_images',
$instance_master_path = '/var/lib/ironic/master_images',
$deploy_kernel = undef,
$deploy_ramdisk = undef,
$pxe_append_params = 'nofb nomodeset vga=normal',
$pxe_config_template = '$pybasedir/drivers/modules/pxe_config.template',
$pxe_deploy_timeout = '0',
$tftp_server = '$my_ip',
$tftp_root = '/tftpboot',
$images_path = '/var/lib/ironic/images/',
$tftp_master_path = '/tftpboot/master_images',
$instance_master_path = '/var/lib/ironic/master_images',
$uefi_pxe_bootfile_name = 'elilo.efi',
) {
# Configure ironic.conf
ironic_config {
'pxe/pxe_append_params': value => $pxe_append_params;
'pxe/pxe_config_template': value => $pxe_config_template;
'pxe/pxe_deploy_timeout': value => $pxe_deploy_timeout;
'pxe/tftp_server': value => $tftp_server;
'pxe/tftp_root': value => $tftp_root;
'pxe/images_path': value => $images_path;
'pxe/tftp_master_path': value => $tftp_master_path;
'pxe/instance_master_path': value => $instance_master_path;
'pxe/pxe_append_params': value => $pxe_append_params;
'pxe/pxe_config_template': value => $pxe_config_template;
'pxe/pxe_deploy_timeout': value => $pxe_deploy_timeout;
'pxe/tftp_server': value => $tftp_server;
'pxe/tftp_root': value => $tftp_root;
'pxe/images_path': value => $images_path;
'pxe/tftp_master_path': value => $tftp_master_path;
'pxe/instance_master_path': value => $instance_master_path;
'pxe/uefi_pxe_bootfile_name': value => $uefi_pxe_bootfile_name;
}
if $deploy_kernel {

View File

@ -23,14 +23,15 @@ require 'spec_helper'
describe 'ironic::drivers::pxe' do
let :default_params do
{ :pxe_append_params => 'nofb nomodeset vga=normal',
:pxe_config_template => '$pybasedir/drivers/modules/pxe_config.template',
:pxe_deploy_timeout => '0',
:tftp_server => '$my_ip',
:tftp_root => '/tftpboot',
:images_path => '/var/lib/ironic/images/',
:tftp_master_path => '/tftpboot/master_images',
:instance_master_path => '/var/lib/ironic/master_images' }
{ :pxe_append_params => 'nofb nomodeset vga=normal',
:pxe_config_template => '$pybasedir/drivers/modules/pxe_config.template',
:pxe_deploy_timeout => '0',
:tftp_server => '$my_ip',
:tftp_root => '/tftpboot',
:images_path => '/var/lib/ironic/images/',
:tftp_master_path => '/tftpboot/master_images',
:instance_master_path => '/var/lib/ironic/master_images',
:uefi_pxe_bootfile_name => 'elilo.efi' }
end
let :params do
@ -51,6 +52,7 @@ describe 'ironic::drivers::pxe' do
is_expected.to contain_ironic_config('pxe/images_path').with_value(p[:images_path])
is_expected.to contain_ironic_config('pxe/tftp_master_path').with_value(p[:tftp_master_path])
is_expected.to contain_ironic_config('pxe/instance_master_path').with_value(p[:instance_master_path])
is_expected.to contain_ironic_config('pxe/uefi_pxe_bootfile_name').with_value(p[:uefi_pxe_bootfile_name])
end
context 'when overriding parameters' do
@ -65,7 +67,8 @@ describe 'ironic::drivers::pxe' do
:tftp_root => '/mnt/ftp',
:images_path => '/mnt/images',
:tftp_master_path => '/mnt/master_images',
:instance_master_path => '/mnt/ironic/master_images'
:instance_master_path => '/mnt/ironic/master_images',
:uefi_pxe_bootfile_name => 'bootx64.efi'
)
end
@ -80,6 +83,7 @@ describe 'ironic::drivers::pxe' do
is_expected.to contain_ironic_config('pxe/images_path').with_value(p[:images_path])
is_expected.to contain_ironic_config('pxe/tftp_master_path').with_value(p[:tftp_master_path])
is_expected.to contain_ironic_config('pxe/instance_master_path').with_value(p[:instance_master_path])
is_expected.to contain_ironic_config('pxe/uefi_pxe_bootfile_name').with_value(p[:uefi_pxe_bootfile_name])
end
end