Forum: Cfengine Help
Subject: Re: Cfengine Help: Re: Controlling Module Calls
Author: nima
Link to topic: https://cfengine.com/forum/read.php?3,18399,18403#msg-18403

I may be doing this wrong, but here it goes:


bundle agent ReIndexOpenLDAP {
    classes:
        "ReIndexOpenLDAP"
            expression => usemodule("ReIndexOpenLDAP", ""), 
            classes => DefineSoftClass("ReIndexOpenLDAP_once"),
            ifvarclass => canonify("!ReIndexOpenLDAP_once")
        ;    

    reports:
        MODReIndexOpenLDAP_Success::
            "[ lib-modules     
]$(ansi.mod)ReIndexOpenLDAP($(ReIndexOpenLDAP.actions))$(ansi.reset)";

        MODReIndexOpenLDAP_Errors::
            "[ lib-modules     
]$(ansi.fail)ReIndexOpenLDAP:$(ReIndexOpenLDAP.errors)$(ansi.reset)";
}


where:

body classes DefineSoftClass(c) {
    promise_repaired => { canonify("$(c)"),        canonify("$(c)_Succeeded") };
    promise_kept     => { canonify("$(c)_Kept")                               
};   
    repair_failed    => { canonify("$(c)_Failed")                             
};   
    repair_denied    => { canonify("$(c)_Failed"), canonify("$(c)_Denied")    
};   
    repair_timeout   => { canonify("$(c)_Failed"), canonify("$(c)_Timeout")   
};   
}


...still no good; and in this case I know that "promise_repaired" is hit, and 
the class canonify("$(c)") is set as expected.

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

Reply via email to