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 
line in my editfiles.cf file:

    files promise by '/etc/default/snmpd' (implicit) if context is any

          edit_line => myreplace(snmpd.pid 127.0.0.1$,snmpd.pid,)            
classes => if_repaired body for type classes
               arg x

               {
               promise_repaired =>  {'$(x)'} if sub-body context any
               }
            Promise (version not specified) belongs to bundle 'editmyfiles' 
(type agent) in file '/var/cfengine/inputs/editfiles.cf' near line 27

and the definition lines look like:

Bundle myreplace in the context of edit_line

   ARGS:

   scalar arg oldv

   scalar arg newv

   {
   TYPE: replace_patterns

      replace_patterns promise by '$(oldv)' (implicit) if context is any

         replace_with => $(newv)       if body context any
            Promise (version not specified) belongs to bundle 'myreplace' (type 
edit_line) in file '/var/cfengine/inputs/editfiles.cf' near line 59


   }

But this doesn't look much different from the functions that come from 
cfengine_stdlib.cf.

Maybe I am doing this the wrong way.  All I want to do is a simple substitution 
of newv for oldv.

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

Reply via email to