Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.
2 changes: 1 addition & 1 deletion manifests/installer.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Define: pxe::installer
#
# Downlaods the requested image and sets up a generic installation entry for
# Downloads the requested image and sets up a generic installation entry for
# each image.
#
define pxe::installer (
Expand Down
33 changes: 14 additions & 19 deletions manifests/syslinux/system.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,19 @@
source => "${syslinux_dir}/pxelinux.0",
require => Package['syslinux'],
}

file { "${tftp_root}/syslinux/menu.c32":
source => "${syslinux_dir}/menu.c32",
require => Package['syslinux'],
}

file { "${tftp_root}/syslinux/vesamenu.c32":
source => "${syslinux_dir}/vesamenu.c32",
require => Package['syslinux'],
}

file { "${tftp_root}/syslinux/reboot.c32":
source => "${syslinux_dir}/reboot.c32",
require => Package['syslinux'],
}

file { "${tftp_root}/syslinux/memdisk":
source => "${syslinux_dir}/memdisk",
require => Package['syslinux'],
$tftproot_syslinux_files = [
'menu.c32',
'vesamenu.c32',
'reboot.c32',
'ldlinux.c32',
'libcom32.c32',
'libutil.c32',
'memdisk',
]
$tftproot_syslinux_files.each |$file| {
file { "${tftp_root}/syslinux/${file}":
source => "${syslinux_dir}/${file}",
require => Package['syslinux'],
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can manage the directory itself. If source is a directory and recurse is set to true, it should copy all files and not need an update if the files change at some point.

Suggested change
file { "${tftp_root}/syslinux/${file}":
source => "${syslinux_dir}/${file}",
require => Package['syslinux'],
}
file { "${tftp_root}/syslinux":
source => $syslinux_dir,
recurse => true,
require => Package['syslinux'],
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the changes I thought would work, but I'm getting CI errors on BSD. An extra set of eyes would be appreciated.

}
}
3 changes: 3 additions & 0 deletions spec/classes/syslinux/system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

it { is_expected.to contain_package('syslinux') }
it { is_expected.to contain_file('/srv/tftp/pxelinux.0') }
it { is_expected.to contain_file('/srv/tftp/syslinux/ldlinux.c32') }
it { is_expected.to contain_file('/srv/tftp/syslinux/libcom32.c32') }
it { is_expected.to contain_file('/srv/tftp/syslinux/libutil.c32') }
it { is_expected.to contain_File('/srv/tftp/syslinux/memdisk') }
it { is_expected.to contain_File('/srv/tftp/syslinux/menu.c32') }
it { is_expected.to contain_file('/srv/tftp/syslinux/reboot.c32') }
Expand Down