Forum: CFEngine Help
Subject: Re: CFEngine Help: Re: "any" usebundle
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,24472,24485#msg-24485
Oace, Tod R Wrote:
-------------------------------------------------------
> I think called bundles should be able to do the
> same thing. All the examples I see just put
> garbage "any" values on the left. Why not use it
> the way that other kinds of promises do?
I use that value as a descriptive name, the same way other promises use it;
usually I choose a more descriptive version of the bundle name, but it always
describes the purpose in one or two words. :) For example, my higher-level
functionality is split up into separate .cf files. For basic system hardening,
I have a file called harden.cf, which starts with a harden bundle that looks
like this:
bundle agent harden {
methods:
any::
"securetty" usebundle => harden_securetty;
use_alpha_config|!cfengine_3_0::
"vars" usebundle => harden_vars;
"classes" usebundle => harden_classes;
"fileperms" usebundle => set_fileperms;
"profile_d" usebundle => harden_profile_d;
"profile" usebundle => harden_profile;
harden_has_accounts::
"homes" usebundle => examine_homes;
}
If your usage model wants to use parameters, just put the parameter in the
argument the same way as all other compound bodies. I'm having difficulty
envisioning a scenario where using the name of a module promise provides any
added value - either in functionality or just prettier syntax - beyond a
parametrized method call or the use of an slist or variable for the promise
name. While I can see the theoretical argument of having the name be accesible
somehow, it'd have to be a new variable; the this.promiser variable anywhere in
a called bundle already has a different meaning, and there's no attribute of
the methods promises (other than possibly "comment") where $(this.promiser)
would make any sense. Maybe if my "measure classes" and "locking at the method
level" enhancement requests get implemented...
On an unrelated note, Tod, did you ever work in the Champaign, IL office? Your
name looks familiar, but it's been ~6 years. :)
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine