Add uefi_pxe_config_template parameter

Add uefi_pxe_config_template parameter with the default value from
Ironic master.

Change-Id: Ibf6a0c6a7702f24895969b2db0e0740274ce9b91
This commit is contained in:
Lucas Alvares Gomes 2016-01-04 16:10:31 +00:00
parent efaf9daa1b
commit 8ce321ae46
2 changed files with 50 additions and 40 deletions

View File

@ -73,32 +73,38 @@
# (optional) Bootfile DHCP parameter for UEFI boot mode.
# Defaults to 'elilo.efi'.
#
# [*uefi_pxe_config_template*]
# (optional) Template file for PXE configuration for UEFI boot loader.
# Defaults to '$pybasedir/drivers/modules/elilo_efi_pxe_config.template'.
#
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',
$uefi_pxe_bootfile_name = 'elilo.efi',
$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',
$uefi_pxe_config_template = '$pybasedir/drivers/modules/elilo_efi_pxe_config.template',
) {
# 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/uefi_pxe_bootfile_name': value => $uefi_pxe_bootfile_name;
'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;
'pxe/uefi_pxe_config_template': value => $uefi_pxe_config_template;
}
if $deploy_kernel {

View File

@ -23,15 +23,16 @@ 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',
:uefi_pxe_bootfile_name => 'elilo.efi' }
{ :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',
:uefi_pxe_config_template => '$pybasedir/drivers/modules/elilo_efi_pxe_config.template' }
end
let :params do
@ -53,22 +54,24 @@ describe 'ironic::drivers::pxe' do
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])
is_expected.to contain_ironic_config('pxe/uefi_pxe_config_template').with_value(p[:uefi_pxe_config_template])
end
context 'when overriding parameters' do
before do
params.merge!(
:deploy_kernel => 'foo',
:deploy_ramdisk => 'bar',
:pxe_append_params => 'foo',
:pxe_config_template => 'bar',
:pxe_deploy_timeout => '40',
:tftp_server => '192.168.0.1',
:tftp_root => '/mnt/ftp',
:images_path => '/mnt/images',
:tftp_master_path => '/mnt/master_images',
:instance_master_path => '/mnt/ironic/master_images',
:uefi_pxe_bootfile_name => 'bootx64.efi'
:deploy_kernel => 'foo',
:deploy_ramdisk => 'bar',
:pxe_append_params => 'foo',
:pxe_config_template => 'bar',
:pxe_deploy_timeout => '40',
:tftp_server => '192.168.0.1',
:tftp_root => '/mnt/ftp',
:images_path => '/mnt/images',
:tftp_master_path => '/mnt/master_images',
:instance_master_path => '/mnt/ironic/master_images',
:uefi_pxe_bootfile_name => 'bootx64.efi',
:uefi_pxe_config_template => 'foo-uefi'
)
end
@ -84,6 +87,7 @@ describe 'ironic::drivers::pxe' do
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])
is_expected.to contain_ironic_config('pxe/uefi_pxe_config_template').with_value(p[:uefi_pxe_config_template])
end
end