Forum: CFEngine Help
Subject: Re: /etc/resolv.conf: if updating, backup first
Author: matt_garman
Link to topic: https://cfengine.com/forum/read.php?3,23954,23959#msg-23959

zzamboni Wrote:
-------------------------------------------------------
> Since you are making reference to the slist
> variables with scalar notation ($(nameservers)
> instead of @(nameservers)), implicit looping is
> happening at this point. Effectively, you are
> calling my_resolvconf multiple times on each run,
> with all the different combinations of the list
> variables. Hence you get the weird and seemingly
> random changes.
> 
> The solution is to pass the whole lists into the
> bundle, and let implicit looping happen inside the
> bundle. This way the bundle gets called only one
> time, and it expand the lists into their values.
> So you need to change the edit_line line to this:
> 
> Hope this helps.

Indeed it does!  After your suggestion, everything is working exactly as I want.

Thank you very much,
Matt

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

Reply via email to