Forum: CFEngine Help
Subject: Re: controlling redhat-style startup services via chkconfig
Author: matt_garman
Link to topic: https://cfengine.com/forum/read.php?3,24162,24165#msg-24165

And also, for what it's worth, if I do away with the "variable" list 
declaration, it works as expected.  "check_service_enabled.cf":

bundle agent check_service_enabled
{
    vars:
        # need_ntp::  "service" slist  => { "ntpd", "named" };
        # !need_ntp:: "service" slist  => { "named" };
        "service" slist  => { "ntpd", "named" };

    methods:
        redhat|centos|SuSE::
            "any" usebundle => rh_chkconfig_status(${service});

    reports:
        need_ntp:: "need NTP";
        !need_ntp:: "do NOT need NTP";
}


When run, prints this:

R: service ntpd is enabled
R: service named is enabled
R: need NTP


The above is what I expect, but I'd like to do it conditionally, based on the 
"need_ntp" class I defined.

Thanks again!

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

Reply via email to