Merge "Conditionalize syslinux requirement"

This commit is contained in:
Zuul 2017-10-25 01:34:01 +00:00 committed by Gerrit Code Review
commit 156fefb529
3 changed files with 29 additions and 9 deletions

View File

@ -36,6 +36,7 @@
#
# [*syslinux_path*]
# (optional) Path to directory containing syslinux files.
# Setting this to False will skip syslinux related resources.
# Defaults to '$::ironic::params::syslinux_path'
#
# [*syslinux_files*]
@ -115,16 +116,18 @@ class ironic::pxe (
content => "r ^([^/]) ${tftp_root_real}/\\1",
}
ensure_resource( 'package', 'syslinux', {
ensure => $package_ensure,
name => $::ironic::params::syslinux_package,
tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
})
if $syslinux_path {
ensure_resource( 'package', 'syslinux', {
ensure => $package_ensure,
name => $::ironic::params::syslinux_package,
tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
})
ironic::pxe::tftpboot_file { $syslinux_files:
source_directory => $syslinux_path,
destination_directory => $tftp_root_real,
require => Anchor['ironic-inspector::install::end'],
ironic::pxe::tftpboot_file { $syslinux_files:
source_directory => $syslinux_path,
destination_directory => $tftp_root_real,
require => Anchor['ironic-inspector::install::end'],
}
}
ensure_resource( 'package', 'ipxe', {

View File

@ -0,0 +1,4 @@
---
features:
- Allow skipping installation of syslinux. UEFI exclusive archiectures do
not have syslinux support.

View File

@ -120,6 +120,19 @@ describe 'ironic::pxe' do
)
end
end
context 'when excluding syslinux' do
before :each do
params.merge!(
:syslinux_path => false,
)
end
it 'should not contain package syslinux' do
is_expected.not_to contain_package('syslinux')
end
it 'should not contain tftpboot syslinux file' do
is_expected.not_to contain_file('/tftpboot/pxelinux.0')
end
end
end
on_supported_os({