Community templates: Changing the Default PXE global template entry doesn't pre-select the proper entry

When a hosts boots and the PXELinux menu is shown, local boot is the default selected entry and the one that will be booted after timeout. This can be changed by changing the “Default PXE global template” setting (e.g. to discovery). In that case, after the timeout, the host nicely starts to discover.

However for as long as the menu is shown, the visually selected entry is still “Default local boot”. That seems confusing.

There seems to be an easy fix by changing the following template and replacing:

DEFAULT menu

by:

UI menu
DEFAULT <%= global_setting("default_pxe_item_global", "local") %>

Is there any reason why this isn’t used already? E.g. is het likely to cause any compatibility issues? Or would this be reasonably to include by default in the community templates.

No this is just a bug, I did not mean to do it in this confusing way. What’s selected should be really booted. Please go ahead with the change and file a PR, thanks!

Thanks for your answer, I created the PR: https://github.com/theforeman/community-templates/pull/589

Although I did add two questions, whether we need to change the following as well to make it consistent:

  1. Do we need to remove the “MENU DEFAULT” directive in the following included pxelinux_chainload snippet? As this makes it redundant.
  2. That also makes me wonder if it is intentional that pxelinux_default_local_boot boots immediately, without a timeout. This template also includes the snippet ‘pxelinux_chainload’. It looks like that was mistakenly (?) changed by this commit.

Apologies I somehow managed to miss your PR! Looking into it.