>> #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
>>     
>
>   

how can i cascade this more so that i have perhaps 5 or even 10 if 
statements ? ie if myhost does not match one of the 10 given then dont 
do anything ?

#set myloc = $getVar("hostname","")split('.')[2]
 #if $myloc == "foo"
echo 'relayhost         = mail.foo' >> /etc/postfix/main.cf;
 #elif $myloc == "bar"
echo 'relayhost         = mail.bar' >> /etc/postfix/main.cf;
 #elif $myloc == "baz"
echo 'relayhost         = mail.baz' >> /etc/postfix/main.cf;
 #else $myloc == "more"
echo 'relayhost         = mail.more' >> /etc/postfix/main.cf;
 #end if

etc etc ??

thanks
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to