On Tue, Aug 16, 2011 at 6:23 AM, jcbollinger <[email protected]> wrote:
[Lots of good ideas]
>
> Of those, I would recommend either extlookup() or your ENC (if you
> have one), with my personal preference being extlookup(). I think
> Hiera may offer an even better solution (though similar to
> extlookup()), but I'm not familiar enough with it to feel comfortable
> recommending it.
Unfortunately I've thought of some of those and they don't quite fit
with our existing infrastructure.
* We're not using ENC
* I want the special information right alongside the node decl. This
reduces chance for error and makes the data more maintainable.
Let me give more background:
We have a nodes.pp with a lot of hosts in it. We map a nodename to a
single class...
node /our-squid\d+/ { include system:our_squid }
node /our-db\d+/ { include system:our_db }
and so on.
We are making a failover site.
node /special-our-squid\d+/ { include system::our_squid}
node /special-our-db\d+/ { include system::our_db }
I don't want to confuse the issue with more details, but due to some
legacy naming conventions, we can't (..shouldn't...) use /^special-*/
to determine the sites are failover. We would like the attribute in
puppet.
I could do class { "system::our_db": failover => failover }, except I
want that failover attribute within the class that system::our_db
derives from.
class system {
// Am I special?
}
class system::our_db($failover) inherits system {
// Am I special, too?
}
So ideally (except that this won't work with the new scoping rules in
the future), I'd like to
node /special-our-db\d+/ { $SPECIAL=true
include system::our_db }
Now, I could make a class
class special($yesorno = false) {
$SPECIAL = $yesorno
}
and include that in all nodes, and change it to false in the special
nodes.... It isn't very elegant and makes our node file a lot
messier. Each node is two lines now.. there must be a more elegant
solution.
Maybe the answer is to make a case statement in the nodes.pp that sets
$IMSPECIAL globally based on the hostname... which was one of your
suggestions. But I don't like maintaining two lists of host regex's,
which could get out of date.
Is there no specifier to reach my node's scope? i.e.,
$mynode::IMSPECIAL? Maybe in Ruby?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.