Daniel Dehennin <daniel.dehen...@baby-gnu.org> writes:

[...]

> The replace_patterns is always repaired:

[...]

Even a simple one like this:

#v+
cat /tmp/main.cf:
smtp_host smtp.example.net2
#v-

#v+
    replace_patterns:

        HasSMTPhost::
            "^(smtp_host)\s+smtp\.example\.net$" replace_with => 
value("$(match.1) $(smtp)2"),
                classes => if_repaired("SomeSMTPHostReplaced"),
                comment => "Replace missconfigured smtp_host";
#v-

with:

#v+
body classes if_repaired(x)
{
    promise_repaired => { "$(x)" };
}
#v-


#v+
/usr/sbin/cf-agent -K
R: I replace some missconfigured smtp_host line
#v-

I'll look at the code when I'll have time.

Thanks.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

Attachment: pgpAxJ6x1o9T8.pgp
Description: PGP signature

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

Reply via email to