Forum: CFEngine Help Subject: Re: CFEngine Help: Re: CFEngine Help: Re: controlling redhat-style startup services via chkconfig Author: matt_garman Link to topic: https://cfengine.com/forum/read.php?3,24170,24176#msg-24176
Jesse Becker Wrote: ------------------------------------------------------- > You can also use common bundles, since they are > all processed before > agent bundles. However, within a common bundle, I > think vars: are still > processed first. The so the ordering is something > like this: > > commmon bundle/vars, iteration1 > commmon bundle/classes, iteration1 > commmon bundle/vars, iteration2 > commmon bundle/classes, iteration2 > commmon bundle/vars, iteration3 > commmon bundle/classes, iteration3 > > agent bundle/var, iter1 > agent bundle/classes, iter1 > agent bundle/var, iter2 > agent bundle/classes, iter2 > agent bundle/var, iter3 > agent bundle/classes, iter3 I think this explains what neilhwatson was trying to say. But actually, this is how I did it: body common control { bundlesequence => { "check_service_enabled" }; inputs => { "classes.cf", "util.cf" }; } bundle agent check_service_enabled { vars: !need_ntp:: "service" slist => { "ntpd", "named" }; need_ntp:: "service" slist => { "named" }; methods: redhat|centos|SuSE:: "any" usebundle => rh_chkconfig_status(${service}); reports: need_ntp:: "need NTP"; !need_ntp:: "do NOT need NTP"; } And then I have this in "classes.cf": bundle common g { classes: "need_ntp" expression => "linux|cfengine_3"; } So my class "need_ntp" is defined in a common bundle... yet it still isn't "instantiated" when check_service_enabled() is called. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine