Use PXE http GET parameter in provision template?

Hello list,

I want to have a machine boot into a pxe menu with two menu options: "clean
install" and "reinstall". The main difference between these are that they
use different partition schemes in my kickstart configuration. I've been
trying to come up with a solution as to how I can build a provision
(kickstart) template in Foreman that can include the correct partition
scheme depending on which install choice the user made.

I stumbled upon this:
http://projects.theforeman.org/projects/foreman/wiki/KickstartStatic

which suggests that you can use http GET parameters from PXE in the
provision templates. I can't get it to work though, maybe that only works
with Foreman <1.8 (i'm running 1.15) and/or with the 'static' parameter?

Anyone know if this is possible? Or how would you solve my 'problem'?

Thanks!

//Adam

ok, i kind of found the answer to this in

lib/foreman/renderer.rb

in function 'load_template_vars', where the @static http parameter is read.
So I can add my own 'reinstall' parameter there and get my kickstart
template to work. Unfortunately this involves altering the Foreman code, so
if anyone knows of a better way to achieve what i want I would be very
grateful!

//Adam

ยทยทยท On Wednesday, June 28, 2017 at 7:48:04 AM UTC+2, AdamW wrote: > > Hello list, > > I want to have a machine boot into a pxe menu with two menu options: > "clean install" and "reinstall". The main difference between these are that > they use different partition schemes in my kickstart configuration. I've > been trying to come up with a solution as to how I can build a provision > (kickstart) template in Foreman that can include the correct partition > scheme depending on which install choice the user made. > > I stumbled upon this: > http://projects.theforeman.org/projects/foreman/wiki/KickstartStatic > > which suggests that you can use http GET parameters from PXE in the > provision templates. I can't get it to work though, maybe that only works > with Foreman <1.8 (i'm running 1.15) and/or with the 'static' parameter? > > Anyone know if this is possible? Or how would you solve my 'problem'? > > Thanks! > > //Adam >