Mark Burgess wrote:

> If the file contains $(macro) like instances already, you could simply
> ask cfagent to expand them using "ExpandVariables".

That's very cool.

> Alernatively you could use a ReplaceAll "xxx" With "yyy"

Following your recent message about how you use this to set variables, `
I tried to use it and ran into some problems. For example, I tried:

    ReplaceAll "^enableRollbacks=.*$" With "enableRollbacks=1"

This produced the following output:

    Begin editing /etc/sysconfig/rhn/up2date
    Checking for global replace/^enableRollbacks=.*$/enableRollbacks=1
    cfengine: WARNING: Non-convergent edit operation ReplaceAll 
[enableRollbacks=1] With [^enableRollbacks=.*$]
    cfengine: Line begins [enableRollbacks=0]
    cfengine: Replacement matches search string and will thus replace every 
time - edit was not done
    cfengine: Error editing file /etc/sysconfig/rhn/up2date

However, that edit is convergent. It will match every time, but the
result will always be the same. I assume the warning above is supposed
to guard against edits like:

    ReplaceALL "ab" With "abab"

which should be prevented. I think cfagent should test whether the
replacement will be *different* every time.

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science
http://www.cs.uchicago.edu/people/brendan


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

Reply via email to