Bug #745
closedPXELinux <%= @host.name %>
Description
When I use the <%= @host.name %> var in my PXELinux file
the template is correctly generated if I acces it from : /unattended/template/$template_name/$hostgroup
but when I click on build I got this error :
"undefined method 'name' for nil:NilClass on generate PXELinux template"
Updated by Ohad Levy over 13 years ago
- Status changed from New to Feedback
that makes sense because you are rendering a non host specific template...
I'm not sure which hostname should it provide?
Updated by Arnaud Sourioux over 13 years ago
when i acces this way /unattended/template/$template_name/$hostgroup the <%= @host.name > is the hostgroup name
wich is logic beacuse it cannot be a particular host name
but it shouldn't give an error if the render was good
when i click on build (for a paricular host), the <= @host.name %> value should be the name of the host i'm trying to build
the point is not if the host name can be used but it shouldn't give an error
Updated by Ohad Levy over 13 years ago
- Status changed from Feedback to Need more information
- Assignee deleted (
Ohad Levy)
maybe I'm missing something here, but if you are using hostgroup deployments, then there is no build option for that?!
Updated by Joshua Hoblitt over 12 years ago
I just hit a very similar, if not the same, issue with a PXElinux template.
It appears that the Intel S5520HC boards that I have don't work with the anaconda argument:
ksdevice=bootif
and I get prompted to select the interface to use for installation. Manually editing the pxe cfg file to have the argument ksdevice=<mac> seems to work and anaconda no longer prompts for interface selection. As a work around, it would be desirable to use @host.mac in PXElinux templates. However, this seems not to work, with or without safe render set. Eg
ksdevice=<% @host.mac %>
causes this error:
Failed to generate PXELinux template: undefined method 'mac' for Safemode::Jail (NilClass)
Updated by Florian Koch over 12 years ago
Hi,
with safemode rendering disabled, this works for me.
Tested on the develop branch
(look at the wiki, there is a hint to strip the @host )
http://www.theforeman.org/projects/foreman/wiki/TemplateWriting
ksdevice=<%=mac %>
Updated by Peter Bauer over 12 years ago
Confirmed here with Foreman 4.2, though this should have been fixed with Bug #653.
Updated by Peter Bauer over 12 years ago
Ohad Levy wrote:
Peter Bauer wrote:
Confirmed here with Foreman 4.2, though this should have been fixed with Bug #653.
If you just use <%= mac %> does it work? my feeling this was already solved via #1385
Hi,
like stated by Florian Koch, the following works for me, but only if safemode rendering is disabled.
ksdevice=<%=mac %>
With safemode rendering enabled, i get the following error:
Failed to generate PXELinux template: undefined method 'mac' for Safemode::Jail (NilClass)
Updated by Ohad Levy over 12 years ago
- Status changed from Need more information to Duplicate