Merge "Debian/Ubuntu: Fix installation of pxelinux.0 and syslinux files" into stable/xena
This commit is contained in:
commit
e95bf0e8b1
|
@ -60,6 +60,8 @@ class ironic::params {
|
|||
$tftpd_package = 'tftp-server'
|
||||
}
|
||||
$ipxe_package = 'ipxe-bootimgs'
|
||||
$pxelinux_package = false
|
||||
$pxelinux_path = false
|
||||
$syslinux_package = 'syslinux-tftpboot'
|
||||
$syslinux_path = '/tftpboot'
|
||||
$syslinux_files = ['pxelinux.0', 'chain.c32', 'ldlinux.c32']
|
||||
|
@ -85,13 +87,11 @@ class ironic::params {
|
|||
$xinetd_available = true
|
||||
$tftpd_package = 'tftpd-hpa'
|
||||
$ipxe_package = 'ipxe'
|
||||
$pxelinux_package = 'pxelinux'
|
||||
$pxelinux_path = '/usr/lib/PXELINUX'
|
||||
$syslinux_package = 'syslinux-common'
|
||||
if ($::os_package_type == 'debian') {
|
||||
$syslinux_path = '/usr/lib/syslinux'
|
||||
} else {
|
||||
$syslinux_path = '/var/lib/tftpboot'
|
||||
}
|
||||
$syslinux_files = ['pxelinux.0', 'chain.c32', 'libcom32.c32', 'libutil.c32']
|
||||
$syslinux_path = '/usr/lib/syslinux/modules/bios'
|
||||
$syslinux_files = ['chain.c32', 'libcom32.c32', 'libutil.c32']
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \
|
||||
|
|
|
@ -34,6 +34,11 @@
|
|||
# deployment images.
|
||||
# Defaults to '8088'
|
||||
#
|
||||
# [*pxelinux_path*]
|
||||
# (optional) Path to directory containing pxelinux.0 .
|
||||
# Setting this to False will skip syslinux related resources.
|
||||
# Defaults to '$::ironic::params::pxelinux_path'
|
||||
#
|
||||
# [*syslinux_path*]
|
||||
# (optional) Path to directory containing syslinux files.
|
||||
# Setting this to False will skip syslinux related resources.
|
||||
|
@ -73,6 +78,7 @@ class ironic::pxe (
|
|||
$tftp_root = '/tftpboot',
|
||||
$http_root = '/httpboot',
|
||||
$http_port = '8088',
|
||||
$pxelinux_path = $::ironic::params::pxelinux_path,
|
||||
$syslinux_path = $::ironic::params::syslinux_path,
|
||||
$syslinux_files = $::ironic::params::syslinux_files,
|
||||
$tftp_bind_host = undef,
|
||||
|
@ -211,6 +217,24 @@ class ironic::pxe (
|
|||
File[$tftp_root_real] -> Service['dnsmasq-tftp-server']
|
||||
}
|
||||
|
||||
# NOTE(tkajinam): Ubuntu/Debian requires a separate package for pxelinux.0
|
||||
# and the file is stored in a different path.
|
||||
if $pxelinux_path {
|
||||
if $ironic::params::pxelinux_package {
|
||||
package { 'pxelinux':
|
||||
ensure => $package_ensure,
|
||||
name => $::ironic::params::pxelinux_package,
|
||||
tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
|
||||
}
|
||||
}
|
||||
|
||||
ironic::pxe::tftpboot_file { 'pxelinux.0':
|
||||
source_directory => $pxelinux_path,
|
||||
destination_directory => $tftp_root_real,
|
||||
require => Anchor['ironic-inspector::install::end'],
|
||||
}
|
||||
}
|
||||
|
||||
if $syslinux_path {
|
||||
ensure_resource( 'package', 'syslinux', {
|
||||
ensure => $package_ensure,
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Now the ``ironic::pxe`` class properly installs the pxelinux.0 file using
|
||||
the separate ``pxelinux`` package in Debian and Ubuntu. The new
|
||||
``pxelinux_file_path`` parameter can be used to determine the source path
|
||||
to locate the file. When this parameter is set to false then the class
|
||||
does not manage the file.
|
||||
|
||||
- |
|
||||
The wrong source directory to copy syslinux files in Debiand or Ubuntu has
|
||||
been fixed.
|
|
@ -136,7 +136,7 @@ describe 'ironic::pxe' do
|
|||
is_expected.not_to contain_package('syslinux')
|
||||
end
|
||||
it 'should not contain tftpboot syslinux file' do
|
||||
is_expected.not_to contain_file('/var/lib/ironic/tftpboot/pxelinux.0')
|
||||
is_expected.not_to contain_file('/var/lib/ironic/tftpboot/chain.c32')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -254,6 +254,30 @@ describe 'ironic::pxe' do
|
|||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'ironic pxe with pxelinux package' do
|
||||
it 'should contain pxelinux package' do
|
||||
is_expected.to contain_package('pxelinux').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:pxelinux_package],
|
||||
:tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
|
||||
)
|
||||
end
|
||||
|
||||
context 'when excluding pxelinux' do
|
||||
before :each do
|
||||
params.merge!(
|
||||
:pxelinux_path => false,
|
||||
)
|
||||
end
|
||||
it 'should not contain pxelinux package' do
|
||||
is_expected.not_to contain_package('pxelinux')
|
||||
end
|
||||
it 'should not contain pxelinux.0 file' do
|
||||
is_expected.not_to contain_file('/var/lib/ironic/tftpboot/pxelinux.0')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
|
@ -267,6 +291,7 @@ describe 'ironic::pxe' do
|
|||
when 'Debian'
|
||||
{
|
||||
:ipxe_package => 'ipxe',
|
||||
:pxelinux_package => 'pxelinux',
|
||||
:syslinux_package => 'syslinux-common',
|
||||
:tftp_package => 'tftpd-hpa',
|
||||
}
|
||||
|
@ -290,6 +315,10 @@ describe 'ironic::pxe' do
|
|||
unless facts[:osfamily] == 'RedHat' and facts[:operatingsystemmajrelease].to_i >= 9
|
||||
it_behaves_like 'ironic pxe with xinetd'
|
||||
end
|
||||
|
||||
if facts[:osfamily] == 'Debian'
|
||||
it_behaves_like 'ironic pxe with pxelinux package'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue