Hi Marco, I think what you should do is to look at not TFM but an STG (Special Topics Guide) that explains why you don't need these things in CFEngine 3. The language contains what you need to make loops and conditionals happen.
For instance, try this for loops: http://source.cfengine.com/websvn/filedetails.php?repname=Cfengine+core&path=%2Ftrunk%2Fexamples%2Funit_iteration.cf and then read this http://cfengine.com/manuals/st-iterate.html#Iterated-promises CFEngine does decisions through "classes". Instead of if $this, you say this:: # for a context in which this is true... (some promise) !this:: # else ... (some other promise) If you are thinking "if ($this)", you are not really thinking in the CFEngine way (which would use "classes/class contexts" to select an outcome) but you could use ifvarclass => "$(this)" to basically this effect in any promise. I recommend looking at this for a very simple decision about when/where: http://source.cfengine.com/websvn/filedetails.php?repname=Cfengine+core&path=%2Ftrunk%2Fexamples%2Funit_commands.cf and then look at this doc: http://cfengine.com/manuals/st-menus.html#How-do-you-create-menus-with-CFEngine Hope this helps. Mark On 10/29/2011 04:08 PM, Marco Marongiu wrote: > Hello there > > I would like to know if there is any real templating system that can be > used in cfengine3, and that is not limited to simple scalar > substitution. I am talking about templates supporting conditionals, like > > if ($this) { add that to the file } > > or array expansion, like > > foreach $server (@servers) { add something with $server } > > I have google'd a lot lately, and done some experiments, but nothing > like that seems to be available. > > Of course I could use a templating system _outside_ of cfengine3 and > create a file for all possible combinations, but that doesn't seem very > scalable to me... > > Any help in the form of pointers, code, or RTFMs will be greatly > appreciated. > > Regards > -- bronto > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine