On Tue, Mar 06, 2012 at 08:04:53AM -0500, Mike Brodbelt wrote: >Hi, > >I have a cfengine config that's not quite doing what I expect. I have a >bundle that's set to install certain packages, and then adds some config >files based on what's been installed. Slightly paraphrasing, the config >I have looks like this:- > > >packages: > any:: > "$(base_list)" > package_policy => "add", > package_method => "apt", > classes => if_ok("class_foo"); > > dell_machine:: > "$(dell_extras) > package_policy => "add", > package_method => "apt", > classes => if_ok("class_bar"); > > >files: > class_foo:: > > <some promises for all machines> > > class_bar:: > > <some extra promises for Dell machines> > > >I have other config that sets the dell_machine class if the server it's >running on is a Dell, and that works reliably. > >What I expect to see from this is that on a non-Dell machine, class_foo >gets set, and on a Dell machine, both class_foo and class_bar get set. >What actually happens is that if the machine is a Dell, *only* class_bar >is getting set, resulting in those machines failing to get the global >configuration applied, as class_foo never gets set. > >Is there a "preferred" way to fix this sort of thing? Either the if_ok >body isn't doing what I expect it to do, or I've misunderstood >something, so if anyone can point me in the right direction on how it >actually works, that would be great.
Does it matter if there are packages that need to be updated/installed? For example, you have packages A,B and C in ${base_list}, and package D in ${dell_extras). When everything is up to date, are the classes asserted properly? If there is an update to, say, package B, is class_foo asserted then? > >Thanks, > >Mike > >P.S. For reference, the if_ok body is from the standard library, and is >specifically defined as:- > >body classes if_ok(x) >{ >promise_repaired => { "$(x)" }; >promise_kept => { "$(x)" }; >} >_______________________________________________ >Help-cfengine mailing list >Help-cfengine@cfengine.org >https://cfengine.org/mailman/listinfo/help-cfengine -- Jesse Becker NHGRI Linux support (Digicon Contractor) :(){ :&:};: _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine