Global default iPXE script for unknown hosts?

Hi,

My basic goal is to distribute a generic VM (VirtualBox) and during the
first boot ask some questions.
Depending on the answers I want create a new host in the Foreman and
provision from there the requested OS.
Because I want to do some fancy stuff for the unknown hosts (like ask the
desired hostname) I'm going for iPXE based booting with the associated
scripting.

Now I read this regarding booting unknown hosts with PXE (without the 'i'):
http://projects.theforeman.org/projects/foreman/wiki/3_state_boot

Known to Foreman and in Build mode

A MAC-specific PXE file is written (OS-specific installer template)

Known to Foreman and not in Build mode

A MAC-specific PXE file is written (Global PXE Localboot template)

Unknown to Foreman

The global default PXE file is used (PXE Default File template)

Essentially I want to have the '3 state boot' option for iPXE.
So far I have not yet been able to find out how to send a "global default
iPXE" in case of an unknown host from the Foreman.

Is this currently possible?

If not yet possible; Do you think this would make sense as a generic
enhancement? If so, I'll put in a feature request.

Is there a better way to do this?

Thanks.

Niels Basjes

Hello,

> Essentially I want to have the '3 state boot' option for iPXE.
> So far I have not yet been able to find out how to send a "global default
> iPXE" in case of an unknown host from the Foreman.
>
> Is this currently possible?

You don't need another template to get iPXE work, just configure your
DHCP server to fetch a default file over HTTP or whatever and you are
good to go. This can happen without Foreman involved.

Now, I havent tested this, but it is theoretically possible to configure
iPXE to get the initial script from TFTP. You could leverage the default
PXE file (pxelinux.cfg/default) to do your iPXE booting. Then you can
use the default template and deploy facilities in Foreman to be able to
edit your file via our templating system.

http://ipxe.org/cfg

Would that work for you?

> If not yet possible; Do you think this would make sense as a generic
> enhancement? If so, I'll put in a feature request.

It makes sense to create one. Please describe what you would expect (new
global template available under http). Maybe we can add a more generic
feature - Global generic template (for all hosts).

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Hi,

Unfortunately I'm in a context where the is already a corporate DHCP + PXE
installation that I cannot modify.
So the direction I'm aiming at is giving people a ipxe.iso file with a
script that essentially says "chain <script from foreman> || boot localdisk"
From there I want to feed a default script that boots the registration
process.
If it is a known system (i.e. after registration) then it will boot the
regular Kickstart/Puppet Foreman controlled installation.
After that it will simply be a known system that boots from localdisk
(controlled via ipxe/foreman).

Niels

··· Op vrijdag 27 juni 2014 11:07:31 UTC+2 schreef Lukas Zapletal: > > Hello, > > > Essentially I want to have the '3 state boot' option for iPXE. > > So far I have not yet been able to find out how to send a "global > default > > iPXE" in case of an unknown host from the Foreman. > > > > Is this currently possible? > > You don't need another template to get iPXE work, just configure your > DHCP server to fetch a default file over HTTP or whatever and you are > good to go. This can happen without Foreman involved. > > Now, I havent tested this, but it is theoretically possible to configure > iPXE to get the initial script from TFTP. You could leverage the default > PXE file (pxelinux.cfg/default) to do your iPXE booting. Then you can > use the default template and deploy facilities in Foreman to be able to > edit your file via our templating system. > > http://ipxe.org/cfg > > Would that work for you? > > > If not yet possible; Do you think this would make sense as a generic > > enhancement? If so, I'll put in a feature request. > > It makes sense to create one. Please describe what you would expect (new > global template available under http). Maybe we can add a more generic > feature - Global generic template (for all hosts). > > -- > Later, > > Lukas "lzap" Zapletal > irc: lzap #theforeman >

Well, for that we already have our own officially supported plugin
called foreman_bootdisk that does the same technique. You can generate
those ISO files using a button in Foreman easily.

Check it out.

LZ

··· On Fri, Jun 27, 2014 at 04:44:19AM -0700, Niels Basjes wrote: > Hi, > > Unfortunately I'm in a context where the is already a corporate DHCP + PXE > installation that I cannot modify. > So the direction I'm aiming at is giving people a ipxe.iso file with a > script that essentially says "chain || boot localdisk" > From there I want to feed a default script that boots the registration > process. > If it is a known system (i.e. after registration) then it will boot the > regular Kickstart/Puppet Foreman controlled installation. > After that it will simply be a known system that boots from localdisk > (controlled via ipxe/foreman). > > Niels > > Op vrijdag 27 juni 2014 11:07:31 UTC+2 schreef Lukas Zapletal: > > > > Hello, > > > > > Essentially I want to have the '3 state boot' option for iPXE. > > > So far I have not yet been able to find out how to send a "global > > default > > > iPXE" in case of an unknown host from the Foreman. > > > > > > Is this currently possible? > > > > You don't need another template to get iPXE work, just configure your > > DHCP server to fetch a default file over HTTP or whatever and you are > > good to go. This can happen without Foreman involved. > > > > Now, I havent tested this, but it is theoretically possible to configure > > iPXE to get the initial script from TFTP. You could leverage the default > > PXE file (pxelinux.cfg/default) to do your iPXE booting. Then you can > > use the default template and deploy facilities in Foreman to be able to > > edit your file via our templating system. > > > > http://ipxe.org/cfg > > > > Would that work for you? > > > > > If not yet possible; Do you think this would make sense as a generic > > > enhancement? If so, I'll put in a feature request. > > > > It makes sense to create one. Please describe what you would expect (new > > global template available under http). Maybe we can add a more generic > > feature - Global generic template (for all hosts). > > > > -- > > Later, > > > > Lukas "lzap" Zapletal > > irc: lzap #theforeman > >


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman