> vars:
> smb_shares slist => readstringlist(
> '/data/smb_shares.lst', '#',
> "\n\n",
> "1000",
> "64000");
> files:
> "/etc/samba/smb.conf"
> perms => mog('644','root','root'),
> create => true,
> template_from => template('/templates/smb.conf'),
> classes => { promise_repaired('bounce_smbd', 'bounce_nmbd'),
> promise_kept(canonify("smbd.conf okay")),
> repair_failed('smbd_conf_error'),
> cancel_notkept(canonify("smbd.conf okay")), };
>
I don't understand where the smb shares comes into it, but any reason
why this doesn't work?
files:
"/etc/samba/smb.conf"
perms => mog('644','root','root'),
create => true,
edit_line => expand_template('/templates/smb.conf'),
...
If you imply that the file contains lists, then that brings up a few
issues about semantics that are unclear, but some solutions are given here:
http://cfengine.com/manuals/st-editing.html#File-templates
Lists inside template files are worth revisiting.
Non-line based editing was never supported in CFEngine 2 or 3 (yet) but
if your files are reasonably well behaved, you can approimate a context
free language like sgml as a regular one, e.g. if the tags are on
separate lines
<ul>
<li> Item 1
<li> Item 2
</ul>
<ol>
You could use
body select_region MySection(x)
{
select_start => "<$(x)>";
select_end => "</$(x)>";
}
To edit only within the section. I should add some examples of sections
to the STG...
M
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine