Foreman selecting wrong PXE Loader for host

I have a host set to use the Grub2 UEFI PXE Loader, but when Foreman sets up its entry under pxelinux.cfg, the file there is generated from PXELinux template, not the PXEGrub2 template.

If I select the resolved Grub2 template, it is in fact the one I want, and it renders and previews correctly. Foreman just isn’t using it when I say to “build” the system.

I’ve checked everywhere I can think to look (OS config, Host groups, etc.) but am clearly missing something.

The problem was a misconfiguration in dhcpd.conf. Once I updated it from the razor-friendly code we had to the newer, Foreman-friendly version, this worked like a champ.

For reference, the update changed this:

subnet 192.168.1.1 netmask 255.255.255.0 {
:
if exists user-class and option user-class="iPXE" {
    filename "boostrap.ipxe";
} else {
    filename "undionly.kpxe";
}
next-server 192.168.1.150;

to this:

subnet 192.168.1.1 netmask 255.255.255.0 {
:
class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
    if option pxe-system-type = 00:00 {
        filename "pxelinux.0";
    } elsif option pxe-system-type = 00:09 {
        filename "shim.efi";
    } elsif option pxe-system-type = 00:07 {
        filename "shim.efi";
    } elsif option pxe-system-type = 00:08 {
        filename "shim.efi";
    } else {
        filename "pxelinux.0";
    }
}
next-server 192.168.1.150;
1 Like