Project

General

Profile

Bug #33937

Cannot change "local boot ipxe template"

Added by Ben Magistro 7 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

First, I know we need to upgrade but looking at the code on github it looks like this might exist in current versions too if we are interpreting things correctly.

Under settings -> provisioning, we have updated "local boot ipxe template" to be a custom template we created however, it appears hosts are still trying to use the "ipxe default local boot" template. As best as we could trace it the model will generate a template name of "ipxe default local boot" (https://github.com/theforeman/foreman/blob/1.22.0/app/models/provisioning_template.rb#L137). The unattended controller would then return either a host specific (don't believe we are using this/is even exposed in the ui?) or a default template (https://github.com/theforeman/foreman/blob/develop/app/controllers/unattended_controller.rb#L115) ignoring the value in settings -> provisioning. This behavior was observed both with a real host boot and with access to `unattended/iPXE?spoof=`.

Is there a setting we missed updating or cache clearing step?

Associated revisions

Revision 281a43f6 (diff)
Added by Ben Magistro 4 months ago

Fixes #33937 - Use local boot template setting

Currently when booting with iPXE, the `iPXE default local boot`
regardless of the configured option in settings. This shifts to looking
up the configured template and falling back to the default if not found.

Signed-off-by: Ben Magistro <>

Revision 131be7a8 (diff)
Added by Ondřej Ezr 4 months ago

Refs #33937 - improve setting usage

Settings should not be accessed through DB.

History

#1 Updated by Lukas Zapletal 7 months ago

Hey Ben,

"local boot ipxe template" is only used when foreman does not have host in the inventory. On the other hand, "ipxe default local boot" will be used for hosts in the inventory. This works the same for all template kinds.

What are you trying to achieve that cannot be done this way?

#2 Updated by Ben Magistro 7 months ago

Hello,

We are trying to have a utilities menu be available for hosts in inventory but not in build. So say we reboot, the default in the menu option might still be a local boot, but if an operator was at the console they could arrow down to something else. In our case we have a firmware update image and gparted that we would like to be available here.

For the templates, I want to confirm I understand when each is used. There are a handful of others that are "kickstart" (or other installer) but don't think those come into play in the sequence we are discussing.

iPXE default local boot -- used for hosts in inventory (and not set to build?)
iPXE global default -- used for unknown hosts
iPXE intermediate script -- used to resolve IP to MAC when dhcp isn't managed

We have overridden the `iPXE default local boot` and `iPXE global default` to include the additional menu items. We have also updated the settings in provisioning for "Global default iPXE template" and "Local boot iPXE template". The global default template is working.

Thanks,

Ben

#3 Updated by Lukas Zapletal 7 months ago

I can confirm your understanding, yeah.

So is this resolved or not?

#4 Updated by Ben Magistro 7 months ago

Then this is unfortunately not resolved as we seem to continue to use the provided "iPXE default local boot" even though we have changed in settings what we want to be used for the "local boot iPXE template". Going back to the source files I initially referenced, unlike the global default which does seem to reference a configurable option from settings, I do not see an equivalent for the local boot. This leads me to believe that while we can override the file in settings it won't actually be used.

#5 Updated by The Foreman Bot 7 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8992 added

#6 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 3.3.0 added

#7 Updated by Ben Magistro 4 months ago

  • Status changed from Ready For Testing to Closed

#8 Updated by Amit Upadhye 2 months ago

  • Category set to Templates

Also available in: Atom PDF