Forum: Cfengine Help
Subject: Re: Cfengine in system configuration files
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,21441,21443#msg-21443

I don't think we can have multiple edit_line attributes for a promiser like 
cfengine2. In cfengine3, you should either

(1) separate it into 2 promises.

"/etc/resolv.conf"
   edit_line => DeleteLinesMatching("^nameserver.*");
"/etc/resolv.conf"
   edit_line => addline($(resolv_fields));


or (2) combine edit_line bundle to do both add and delete lines

bundle edit_line maintain_resolv_conf(dregex,aregex)
{
delete_lines:
   "$(dregex)";
insert_lines:
   "$(aregex)";
}


Cheers,
--Nakarin

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to