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

Larry Ludwig
Sat, 22 Aug 2009 16:59:44 -0000

On Aug 22, 2009, at 6:04 AM, Duncan Hill wrote:

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

No problem.  You will find this methodology works well with external
nodes.

-L

--
Larry Ludwig
Reductive Labs