Bug #16654
closedError while building host using `PXEGrub2 global default` provisioning template
Description
There seems to be a problem with using `PXEGrub2 global default` provisioning template:
Rendering the template fails with:
"Unable to render PXEGrub2 template 'PXEGrub2 global default': undefined method `each' for nil:NilClass"
foreman/production.log:
https://paste.fedoraproject.org/432624/53048147/
1. assign `PXEGrub2 global default` template as a PXEGrub2 template to some host
2. try to provision (build) host using this OS
3. the build will be rolled back due to error during rendering the template
Updated by Dominic Cleal about 8 years ago
- Category set to Templates
- Status changed from New to Feedback
It looks like you've associated this template to an operating system/host, but it's not meant to be used that way. The global default templates are written by pressing the build PXE default buttons and are written to /default or similar - a default template isn't applicable to hosts, hence the error.
Use an OS-specific GRUB2 template instead for OSes and hosts, e.g. Kickstart default PXEGrub2
.
Updated by Mathieu Parent almost 8 years ago
But there is no "Preseed default PXEGrub2". How to build one?
Related to #17297.
Updated by Dominic Cleal almost 8 years ago
Use "New Template" under Hosts > Provisioning Templates and set the type to "PXEGrub2 template". Don't use the name "default" if it's not shipped by default - use any name you like.
Updated by Mathieu Parent almost 8 years ago
I've proposed https://github.com/theforeman/community-templates/pull/346, however it doesn't work as GRUB2 in Debian jessie (and apparently stretch too) only try to download ''grub2/grub.cfg'' (and not the filename with MAC address).
Fedora has several patches to handle this at http://pkgs.fedoraproject.org/cgit/rpms/grub2.git/tree/:- 0019-Add-fw_path-variable-revised.patch
- 0025-Search-for-specific-config-file-for-netboot.patch <--- This is the main one!
- 0049-use-fw_path-prefix-when-fallback-searching-for-grub-.patch
- 0050-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch
- 0061-Try-prefix-if-fw_path-doesn-t-work.patch
Workaround is
sudo ln -s grub.cfg-01-... /srv/tftp/grub2/grub.cfgbut you can only provision one host at a time.
And even with the workaround, I get:
boot/Debian-8.6-x86_64-linux has invalid signature you need to load the kernel first
Updated by Lukas Zapletal almost 8 years ago
- Status changed from Feedback to Closed
Hello, thanks for info. I will carry on in the PR which is more relevant place. I think this can be closed now. Feel free to reopen if you think we have a bug in Foreman core.