Forum: Cfengine Help
Subject: Re: Set class on file changes
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,19601,19656#msg-19656

sometimes reading the reference manual is useful ;> Your code must be rewritten 
like this:

bundle agent ntp {
 files:
  Hr05.Min40_45::
    "/etc/ntp.conf"
        copy_from       => 
remote_cp("$(g.cfe_server)","$(g.masterfiles)/global/etc/ntp.conf"),
       action          => if_repaired("ntp_update");

commands:
    ntp_update.SuSE::
       "/etc/init.d/ntp restart";
           
    ntp_update.!SuSE::
       "/etc/init.d/ntpd restart";
}

body action if_repaired(x)
{
  promise_repaired => { "$(x)" };
}


The body action if_repaired can be found in cfengine_stdlib.cf, btw.

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

Reply via email to