On 02/20/2012 04:01 PM, Wes Hardin wrote:
> "A seperate bundle for each node" seems like a lot a bundles to me and
> "change the global reference ... each time i add a new node" seems like a lot
> of changes.
>
> How are you calling these node_specific_bundlenames? Individually classed
> methods promises?
I can see how you could consider it excessive. It is certainly more
excessive than having a single place to define all host networking or
host networking for a class of machine.
Mostly I chose to do it with a single file and bundle for each specific
node because it reduces the surface area to look at when operating at a
single node level. The deployment I am working on is pretty small with <
100 nodes. Its not uncommon to need something specific on only a single
node so it also gives me a logical place to store the other
configuration that is specific to a single node.
I have not yet attempted to get dynamic inputs working but I have a
dynamically classed methods promise to call the individual bundles.
I have a common bundle called first and the variable cuqhost gets defined.
"cuqhost" string => canonify("$(sys.uqhost)");
I then call my main bundle where I have a classes promise define
"node_specific_config_exists" if it detects a node specific
configuration file.
"node_specific_config_exists" expression =>
fileexists("$(sys.workdir)/inputs/node_$(site.cuqhost).cf");
Then I have a methods promise that calls the node specific bundle.
node_specific_config_exists::
"node_specific" usebundle => "$(site.cuqhost)";
This does depend on having a bundle name that is the canonified form of
the sys.uqhost variable.
> Sure thing. Two examples here, both share a common global multi-dimensional
> array which I have broken down by site. DNS config uses slist for
> nameservers. NIS config uses getindices to iterate over NIS servers. This
> is not a full working example, how I set my $(mysite.site) variable is
> missing as are some class bodies (which may come from the COPBL). IPs and
> host names have been changed to protect me from doing something stupid.
Thanks for sharing I will be sure to study them closely when I have a
bit of time.
--
Nick Anderson <[email protected]>
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine