Forum: CFEngine Help
Subject: Re: About "new" templates correct usage or limitations
Author: th
Link to topic: https://cfengine.com/forum/read.php?3,26723,26845#msg-26845

zzamboni Wrote:
-------------------------------------------------------

> > - expand_template :
> > 
> >   . why doesn't it empty the file first ? (as
> > edit_template does). The cost here is a longer
> run
> > time starting from the second run.
> 
> Because expand_template (and expand_scalars) is
> meant to be a generic file-editing mechanism, not
> a complete templating solution.

Ok. But, as expand_template, the term may be misleading to me.

> Mike Svoboda posted an example of how they do
> fairly complex whole-file templating (for
> sysctl.conf, in his example):
> https://cfengine.com/forum/read.php?3,24105,24120,
> including parameters that may or may not be
> defined on some systems.

Thanks, I'll take a look.

> >   . with insert_lines, non-existing inserted
> lines
> > are append at the end
> 
> You can control this with location:
> https://cfengine.com/manuals/cf3-Reference#locatio
> n-in-insert_005flines or select_region, although
> it depends a lot on the file.

I know. But that's why I said template solution was easier to code.


> Yes, but indentation should not matter too much
> for functionality, except for human-readability,
> but if the file is being maintained by CFEngine,
> that might not be much of a concern.

You've got an argument, indeed.

> Which reminds me - I've been meaning to add
> Host/User section support to that bundle for some
> time... :)

Could be useful indeed.

Thanks

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to