Forum: Cfengine Help
Subject: Re: simple edit_line
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,19617,19661#msg-19661
Yep, the one level down is required. Look for body replace_with With(x) in
cfengine_stdlib.cf
___
Help
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,19617,19660#msg-19660
Replace_with should point to a body part not the string.
http://www.cfengine.org/manuals/cf3-reference.html#replace_005fpatterns-in-edit_005fline-promis
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: bidwell
Link to topic: https://cfengine.com/forum/read.php?3,19617,19659#msg-19659
OK here is a simple promise that is wrong somewhere.
bundle agent editmyfiles
{
files:
any::
"/tmp/test"
edit_line => myreplace("line1","l
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: zzamboni
Link to topic: https://cfengine.com/forum/read.php?3,19617,19652#msg-19652
Could you post a self-contained example (as simple as possible) that shows this
problem? Makes it much easier to try it on our own and see what's wrong.
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: bidwell
Link to topic: https://cfengine.com/forum/read.php?3,19617,19648#msg-19648
It still stops after doing the update.cf file transfers. It does produce a
promises.cf.txt though which has an entry like the following for almost every
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,19617,19641#msg-19641
What happens if your replace pattern is just $(oldv)? I worry that the .*'s
might be greedy In which case .*? might be safer.
__
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: bidwell
Link to topic: https://cfengine.com/forum/read.php?3,19617,19639#msg-19639
I see that there are a number of "extensions" to edit_line in
cfengine_stdlib.cf, but I don't see any of them that do a simple replacement of
string1 with
Forum: Cfengine Help
Subject: Re: simple edit_line
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,19617,19619#msg-19619
Look for body replace_with in the Cf3 reference:
7.9 replace_patterns promises in ‘edit_line’
___
Help