On Thu, Mar 26, 2009 at 9:30 AM, Tom Brown <[email protected]> wrote: ... > 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 > > if $getVar("hostname") = bar do something_else > > and if $getVar("hostname") = baz do this final thing > > i know this is basic stuff and i can do it with case but i think i need to > adapt! > > thanks
This looks like a pretty good example of an if --> elsif --> else conditional in cheetah: http://www.cheetahtemplate.org/docs/users_guide_html_multipage/flowControl.if.html Here is a cheesy way to test it in cobbler. Create a blank profile for testing and assign an empty file as the ks.cfg. Then put your snippet in that blank config and assign it to a system. Then you can do "cobbler system getks --name snippettest" to render your snippet. That should get you started in the right direction. If you make something worth sharing please put it on the wiki in the snippets section. -- Jeff Schroeder Don't drink and derive, alcohol and analysis don't mix. http://www.digitalprognosis.com _______________________________________________ cobbler mailing list [email protected] https://fedorahosted.org/mailman/listinfo/cobbler
