Used Foreman’s Build PXE Default to create tftpboot ‘default’ file
Forced to modify ‘default’ file with hard-coded reference to a specific OS version.
Multiple OS version images are uploaded to the boot directory.
APPEND initrd=boot/OracleLinux-8.3-x86_64-initrd.img ks=http://mypuppetserver.luminexcorp.com:80/unattended/provision network ks.sendmac
Issue: I need to be able to choose different OS vmlinuz versions. I attempted several unsuccessful variations within the default file to accept variables fed from foreman pxelinux templates to which I specify different OS versions to boot from.
Need capability to kickstart/boot from multiple OS versions from within tftpboot directory.
Foreman and Proxy versions:
Latest Foreman and Proxy plugin versions:
Latest Distribution and version:
3.0 Other relevant data:
This is not how Foreman works. See, Foreman always assumes you are installing a single OS and it will only prepare PXE files for that particular OS. Template is rendered with variables set in a way that you are installing that OS, meaning PXE kernel and initramdisk is set to a single path. This wont work.
However, Foreman has a (quite hidden) feature that allows you to do exactly what you need - this is called a hostgroup provisioning. You create multiple hostgroups like Debian 10, CentOS 8 Stream and AlmaLinux 8.5 and then after association of hostgroup combinations, you can actually start servers and register them into Foreman even without creating them in Foreman in advance. That is the good news for you.
The bad news is this is not documented, I would love to remove this feature at some point and replace with with more simple approach - just a single template (PXE, provision), a button that would download all PXE files and registration via our host registration snippet instead of Puppet. Similar question last year:
Here is a video that describes, it is longer because it also shows how to synchronize content via Katello, if you do not use Katello you can just skip this and simply use an installation media:
Thank you for the response. To confirm, for my understanding…
I have an older puppet/foreman v1.10 currently working and able to boot/install multiple versions of OS’s. From Centos ISO images, Redhat, to Oracle Linux, I am able to create new servers by selecting the OS of choice from the Foreman create host provisioning menu.
The latest Foreman 3.0 I have installed, I have made use of the ‘host group’ provisioning option and associated the media directory paths, environment, etc… and am still forced to use the first hard-coded option within the default file as noted above.
I will review the video and see if there is something within that I may have missed. We don’t use Katelo.
If I set the default file to a generic entry as follows, when booting the newly created server, it says it cannot find the local OS image. I have verified the tftp and dhcp next_server variable are set correctly.
MENU TITLE PXE Menu
MENU LABEL (local)
This same default file is used on the older puppet/foreman 1.10 server successfully. I have taken extensive time cross-comparing the older server configuration with the new puppet/foreman configuration and as of yet am unable to determine why 1.10 works and 3.0 doesn’t.