Tom Brown wrote:
>
>> On Thu, Mar 26, 2009 at 6:22 AM, Michael DeHaan <mdehaan(a)redhat.com>
>> wrote:
>>
>>>> can i ask you to explain how in your example the system_name is
>>>> set as i
>>>> see it starts with
>>>>
>>>> #if $getVar("system_name","") != ""
>>>>
>>>> but where does 'system_name' come from ?
>>>>
>>>> thanks
>>>> _______________________________________________
>>>>
>>> Internals magic, basically.
>>>
>>> The variable "$name" was confusing because if you were on a
>>> per-profile
>>> kickstart, it's different than a per-system kickstart. So I added
>>> some
>>> extra code to create some extra variables, so whether I was doing a
>>> profile
>>> install or a system install, I always knew that $profile_name
>>> referenced the
>>> name of the profile.
>>>
>>> "cobbler system dumpvars --name=foo" will show you all of them.
>>>
>>
>>
>
> this is very neat and it seems that i can use the variable 'hostname'
> as set in cobbler to do what i want.
>
> could anyone offer me a slight hint on something that would basically do
>
> if $getVar("hostname") = foo do something
#set myhost = $getVar("hostname","")
#if $myhost == "foo"
something
#elif $myhost == "bar"
something something
#else
yet another something
#end if
Generally if checks on the hostname are a sign you're doing something
a little complicated.
The "Advanced Snippets" on the Wiki, for instance, allow you to
override a snippet on a per-profile or per-system basis which can be
pretty cool.
Plenty of good docs are also at:
http://cheetahtemplate.org/learn.html