On Wed, Feb 29, 2012 at 7:56 AM, Stuart Sears stuart@sjsears.com wrote:
On 29/02/12 12:28, Robert Jacobson wrote:
On 2/29/2012 2:12 AM, André Gemünd wrote:
Indeed. The kickstart templates are evaluated by cheetah, which attempts to substitute variables for just about anything it sees beginning with a '$' symbol, unless it's marked as raw text, or part of a cheetah instruction. Some things definitely trip it up. The $() construct is one of them.
more info here: https://github.com/cobbler/cobbler/wiki/kickstart%20templating
The Cheetah user guide is also handy for language docs http://packages.python.org/Cheetah/users_guide/language.html
If you're doing any kind of shell scripting, get to know and love #raw. It makes life a lot easier, especially if your shell scripts aren't using cobbler variables. Even then, there are ways to get around that:
#set foo = $getVar('foo','foo was not set by cobbler') export FOO=$foo #raw echo $FOO #end raw
This is really useful, for example if you have shell script generating other scripts in %post (ie. firstboot/rc.local stuff) so you don't have to do stuff like \$variable all the time. The keep_ssh_host_keys snippet that ships with cobbler shows a snippet that is completely wrapped by #raw/#end raw, since it doesn't require any access to cobbler variables to function.