2009/8/20 Larry Ludwig <[email protected]>:
>
>
> On Aug 19, 2009, at 11:03 AM, Duncan Hill wrote:
>
> why not define the variables per 'node'?  Why use inheritance at all?
> Personally I'm not a fan of node inheritance and like putting all of
> the classes in another class which then is in included in each node.

I can do this, it just amplifies my work rather than reducing it.

The scenario is multiple stacks of 'identical' servers - Glassfish,
Tomcat, Postgres.  All of them have identical host files in terms of
names that are aliased to the IP addresses, it's just the addresses
that change.  (Basically, umpteen development or QA environments in
VMware, all configured the same barring the IPs that the symbolic
names point to.)

So each node needs to define a set of IP addresses in variables, and I
just change the block of variables for each server, conditional on the
hostname, generating custom host addresses.  Well, that was the theory
at least.

I've tried the approach of

node foo {
 $ip1 = 1.1.1.1
 $ip2 = 2.2.2.2

 include host_definitions
}

class host_definitions {
 host {
  'fred': { ip => $ip1, alias => [ a, b, c ] }
 }
}

and more often than not I get an error that $ip1 isn't defined, and
puppet falls over in a heap.

Inheritance has been useful for me, but I am actually moving a lot of
code over to class/module based (as and when I can; the current system
works, and I have enough keeping me busy that rewriting it isn't high
on the list).

Cheers.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to