Hi Scott,

Welcome to the world of Cfengine!
Cfengine should not write a file unless the result of all operations
on it makes it different to the current version of it.
The verbose print just shows what is being done to construct an
internal representation of it.

To check that the file does not get written every time, just do a ls
-l and check the modification time before and after running cf-agent.

Good luck with your Cfengine setup.

--
Regards,
Eystein

On Wed, Apr 13, 2011 at 3:09 PM, Scott Dobner <scott.dob...@sas.com> wrote:
> Hi all,
> I just recently started using CFEngine 3 and was wondering what the best
> practice for constructing system configuration files (e.g.,
> /etc/resolv.conf) is.  Right now I am just adding and deleting lines from
> the file, but it seems to execute with every run of cf-execd.  On the other
> hand, I am pulling down a global /etc/passwd file from the server, and that
> seems to execute much more efficiently since it only gets copied when I make
> changes to that.  Any suggestions would be greatly appreciated!
>
> Also, here is the bundle I am currently trying to execute.  The delete_lines
> doesn’t seem to work, but that is probably my fault and I will just look
> further into it.
>
> bundle agent resolv_file
> {
>         vars:
>           "resolv_fields" slist => {"search <search domains>","nameserver
> <ip>","nameserver <ip>","nameserver <ip>"};
>         files:
>           "/etc/resolv.conf"
>                 edit_line => DeleteLinesMatching("^nameserver.*"),
>                 edit_line => addline($(resolv_fields));
> }
>
> bundle edit_line DeleteLinesMatching(regex)
> {
>         delete_lines:
>           "$(regex)";
> }
>
> bundle edit_line addline(resolvList)
> {
>         insert_lines:
>           "$(resolvList)";
> }
>
> Thanks,
> Scott
>
> _______________________________________________
> 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

Reply via email to