Forum: CFEngine Help Subject: Re: Execution order (was: classes not working in vars?) Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,25293,25399#msg-25399
Oace, Tod R Wrote: ------------------------------------------------------- > On Mar 16, 2012, at 9:46 AM, Nick Anderson wrote: > We're doing a bunch of not_has_shortname style > classing here. Usually it's to use > $(other_bundle.variable) if that variable is > defined or to use a default value if it's not. I typically use a separate bundle for the default/override assignment. So, if I have a "networking" bundle, I'd have a "networking_vars" bundle which sets a variable like "netmask" to either "netmask_default" or "netmask_override". Then in the networking bundle, I just reference "networking_vars.netmask" so all the logic is hidden. That doesn't simplify all of your concerns, but does potentially free up one pass through the promise while variable values stabilize. I've been meaning to extend that approach and try making a parametrized bundle which takes the varaible as input (say, "bundle agent overrideable(varname)"), but I've been too busy to figure out how CFEngine handles variable namespacing when I call the same bundle name several times. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine