[Puppet Users] Re: Conditional host file entries, Puppet''s non-sequential tree

Duncan Hill
Sat, 22 Aug 2009 10:04:55 -0000

2009/8/21 Duncan Hill <bajandude@googlemail.com>:
> 2009/8/20 Larry Ludwig <larry@reductivelabs.com>:
>>
>>
>> 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.

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

Well, now it works.  So I''ll spend the weekend refactoring my setup to
behave in this manner, and hopefully lots of problems will go away.
Thanks Larry.