Setting default template when rebooting host set to "build"

Problem:
I add a host, set it to build and reboot but am presented a menu that includes my custom template but selects the wrong menu item.

Expected outcome:
Reboot it and it gets imaged using my custom template.

Foreman and Proxy versions:

Foreman and Proxy plugin versions:
3.4
Distribution and version:
Redhat 8.7

Other relevant data:
So i have a working kickstart that is fine when I manually reboot and select it from the menu. I set it as the default kickstart for my host group and added the host to the hostgroup. When editing the host I can see that is the assiggned template. Host is set to build mode. I reboot and see this menu:

My kickstart is at the bottom, the #1 item gets selected, fails and then it just boots the existing OS. I’ve been looking at videos and the official documents and don’t see exactly where I’m failing to get this to work.

I used build PXE Default which added in my template to the menu and I’m assuming that’s where the other menu items come from. How do I just get it to use my template.

It’s “pending installation” with the legacy UI.

When I review the provisioning template it’s the correct one.

I’m assuming that I’m just getting the usual manual pxe boot menu for some reason and maybe foreman doesn’t have the permissions it needs to take control of PXE when I reboot the host?

Thanks for the input.

so I only see the menu if I reboot to PXE. Foreman definitely is not in control of what happens on a host set to “build” “pending installation” on its next reboot.

So what am I missing if anyone can help me please. I’m using chatGPT, search engines, searching these forums, reading over the documents and I’m at a loss what I’m overlooking.

thanks.

I think what you are missing is setting the “PXELinux template”. This is what controls the menu items in the PXE boot menu when a host is in build mode.
From the looks of it, your host currently recieves the “PXELinux global default” template, which is designed to be kind of a “catch all” solution if the user has not configured anything. Go to your operating system, edit it, and on the “Templates” tab, select “Kickstart default PXELinux”. This template ships with Foreman by default, and is designed to to boot into the Kickstart process by default.

1 Like

Thank you for your kind reply areyus. I’m trying that but I’m still getting the global menu that exists on the backend at:

/var/lib/tftpboot/grub2/grub.cfg
/var/lib/tftpboot/pxelinux.cfg/default

When I associate a custom template that I want used by default to a host group and hit Build PXE Default I can see those files above get the new entry and they are at the bottom, which I’m assuming is the global default you spoke of.

I think you’ve got me on the right path and I’ll keep playing around. I was missing the "Kickstart default PXELinux” from the OS and updated that but still no luck and it’s forcing me to manually arrow through the global default menu to pick my desired template rather than automatically imaging a host set to build on the next reboot and the “pending installation” and set to build do not get unflagged.

Just a wild guess: What have you set on your host under “Operating System” → “PXE loader”?
For me it is “PXELinux BIOS”. I am not entirely sure what that changes in the background tbh, but I remember provisioning only working with this specific option in our environment (that was 5 years ago when we set the environment up, though). Maybe this helps :slight_smile:

1 Like

it’s sort of working now.

When I set a host to “build” it now images with the Host Group’s associated custom Provisioning Template. Thank you for helping me with that, that was a big step.

However, if I remove the build mode and PXE boot, now I only get presented with the grub.cfg menu without my custom templates, even though they are still there on the back end. I need to be able to manually boot some machines and select those kickstarts. I have to say that I’m becoming increasingly frustrated with Foreman and the seeming black box of behaviour.

Is this expected that I won’t be able to see my templates that I added to grub.cfg after I used “Build PXE Default” in templates. It makes no sense to me. The file is being loaded but where are my custom templates?

Here are my entries in grub.cfg

Sorry disregard the second half of the above ( I exceeded the time to edit) .

I realized if I just make a VM and PXE boot without it being part of a host group it works and presents me with the full grub.cfg menu, which I suppose is good since I don’t want servers managed, only workstations and render. So I guess it’s working.

Now I just have to figure out a couple of other problems, but I’ll search and maybe post about them, so as not to hijack my own thread. Boot order changing (I want PXE to stay #1) and build mode not clearing.

Thank you so much for you help. I was really sinking into despair for a couple of days. I don’t normally struggle this much with solving problems. You input really helped get me on track and I appreciate it.

I’ll mark this as resolved.