Simon Woolsgrove wrote: > Is it possible to select a snippet using a variable e.g. SNIPPET::$mysnippet > ? When I try this nothing is loaded even though the variable is set, I am > guessing cheetah/cobbler is not rendering these ? > >
Yes, SNIPPET's are converted by a pre-processing step that, while using the Cheetah API, happens before variable substitution. I would just use Cheetah's built in include for this. > I want a way to pass application configs and user contributed scripts into > %post without having to generate a profile for each due to the number of > different combinations. > > Currently I am passing the requested configs via --ksmeta "appconfig=fred" > and using #include $appconfig ... the imported files still appear to be > rendered by cheetah, is there any difference between an #include vs SNIPPET ? > There are not a whole lot of differences -- The most notable difference is the "Advanced Snippets" capability described here: https://fedorahosted.org/cobbler/wiki/KickstartSnippets, otherwise it is largely syntactic sugar. What you are doing is definitely fine, so I would not worry about trying to make it use the SNIPPET:: syntax if you don't need to override snippets on a per-profile or per-system basis. If you're really getting into Cheetah, you might be interested to know that with Dan G's recent patches, SNIPPET::foo is equivalent ot $SNIPPET('foo') and Snippets are implemented as functions inside of Cheetah. This particular function is defined in a Python file, but you can see some examples of other demo functions (at least on the devel branch) defined in /etc/cobbler/cheetah_macros. So if you wanted to write your own function that behaved like SNIPPET or include but had some extra magic in it, it supports that. --Michael > Cheers, > Simon > _______________________________________________ > cobbler mailing list > [email protected] > https://fedorahosted.org/mailman/listinfo/cobbler > _______________________________________________ cobbler mailing list [email protected] https://fedorahosted.org/mailman/listinfo/cobbler
