puppet-pxe
puppet-pxe copied to clipboard
Ubuntu URL path has changed as of focal
Affected Puppet, Ruby, OS and module versions/distributions
- Distribution: Ubuntu, 20.04 focal
- Module version: master
How to reproduce (e.g Puppet code you use)
Just copy from the example in the README, but use Ubuntu 20.04 focal in place of Debian
$ubuntu_architectures = ['amd64']
$ubuntu_versions = ['focal']
$ubuntu_versions.each |$ver| {
$os = 'ubuntu'
$ubuntu_architectures.each |$arch| {
pxe::installer { "${os}_${ver}_${arch}":
arch => $arch,
ver => $ver,
os => $os,
file => "os_${os}",
kernel => "images/${os}/${ver}/${arch}/linux",
append => "initrd=images/${os}/${ver}/${arch}/initrd.gz text",
}
}
}
What are you seeing
The URL for netboot images in Ubuntu 20.04 focal has changed, resulting in 404 errors using the URL constructed by the pxe::images::debian
type in this module.
What behaviour did you expect instead
Ubuntu netboot images to download without error
Output log
Error: 'wget http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz' returned 8 instead of one of [0]
Error: /Stage[main]/Profile::Gateway::Pxe/Pxe::Installer[ubuntu_focal_amd64]/Pxe::Images[ubuntu focal amd64]/Pxe::Images::Debian[ubuntu focal amd64]/Exec[wget ubuntu pxe initrd.img amd64 focal]/returns: change from 'notrun' to ['0'] failed: 'wget http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz' returned 8 instead of one of [0] (corrective)
Any additional information you'd like to impart
The old URL pattern constructed by this module, which no longer works for Ubuntu 20.04 focal, is: http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux
The new URL pattern which does work for Ubuntu 20.04 focal, is:
http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ubuntu-installer/amd64/linux
I have tested a quick workaround in bithedge/puppet-pxe@32946b60d3794ef08f76833a1fa1ac011fbda067 - unfortunately I believe that limited-scope fix would be breaking for other Debian/Ubuntu versions, so a more thorough refactor would be required to maintain compatibility while still fixing this issue. I suggest allowing the user to provide more of the URL as an input in order to avoid additional refactoring in the event of further URL pattern changes.