Project

General

Profile

Actions

Bug #745

closed

PXELinux <%= @host.name %>

Added by Arnaud Sourioux about 13 years ago. Updated about 12 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Unattended installations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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"


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #1385: Allow @host.model in provisioning templatesClosedMikael Fridh12/08/2011Actions
Actions #1

Updated by Ohad Levy about 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?

Actions #2

Updated by Arnaud Sourioux about 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

Actions #3

Updated by Ohad Levy almost 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?!

Actions #4

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)
Actions #5

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 %> 
Actions #6

Updated by Peter Bauer about 12 years ago

Confirmed here with Foreman 4.2, though this should have been fixed with Bug #653.

Actions #7

Updated by Ohad Levy about 12 years ago

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

Actions #8

Updated by Peter Bauer about 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)

Actions #9

Updated by Ohad Levy about 12 years ago

  • Status changed from Need more information to Duplicate
Actions

Also available in: Atom PDF