On Tue, Apr 9, 2013 at 2:15 PM, Guillaume Rozan <[email protected]>wrote:
> Hi,
>
> thanks for taking the time to help.
>
> I could configure PXE in the way you describe, but then all the clients of
> a given subnet will be associated to a specific profile (meaning a specific
> distribution in my case)
> What I want to achieve is a bit like a self-service portal.
> You PXE boot the machine, and choose which distribution you want (rh5,
> rh6, etc)
>
> Then your location is automatically detected by Cobbler, and some
> site-specific things happen (like using the mirror copy of the source tree,
> setting the timezone, etc).
> All this automatically happens in the kickstart file, with a call like
> getvar('ip_address') followed by a couple of conditional statements.
>
> The problem is I can't figure out a way to get this IP address, as there's
> no "cobbler system" existing for each client machine
>
Why not do this with a ksmeta variable, rather than the IP? Just create
child profiles and set a ksmeta key there that indicates what post-install
actions you want to take. These profiles will show up in the menu when you
pxe, so your users would still be able to self-service.
For example (assuming you have rhel5/rhel6 distros):
$ cobbler profile add --name=rhel5-x86_64-zone1 --parent=rhel5-x86_64
--ksmeta="zone=1"
$ cobbler profile add --name=rhel6-x86_64-zone1 --parent=rhel6-x86_64
--ksmeta="zone=1"
$ cobbler profile add --name=rhel5-x86_64-zone2 --parent=rhel5-x86_64
--ksmeta="zone=2"
$ cobbler profile add --name=rhel6-x86_64-zone2 --parent=rhel6-x86_64
--ksmeta="zone=2"
Then in your %post snippet:
#set zone = getVar("zone",1) ## default to zone 1
#if $zone == 1
...
#elif $zone == 2
...
#end if
_______________________________________________
cobbler mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/cobbler