On Monday, 9 March 2015 14:45:38 UTC+1, Christopher Wood wrote:
>
> On Sun, Mar 08, 2015 at 11:55:03AM -0700, Bostjan Skufca wrote: 
> >    With hiera: 
> >    - How would you go about when certain nodes need data merged from all 
> >    scopes, but other nodes need data from just the last scope? 
>
> I've usually had a "classname::merge: true" key in hiera, controlling 
> whether I use hiera() or hiera_hash() to obtain the data I need. 
>

And this hits the nail on the spot, even if unknowingly:)

The problem I am seeing here and which I am only now being able to 
articulate, is the clash of two contradictory elements:
1. Puppet development is pushed towards decoupling code (manifest) from 
data, a noble goal
2. Puppet provides two functions, hiera() and hiera_array(), and the very 
existence of more than one function to retrieve data destroys the notion, 
that code should be unaware of underlying data storage details.

Though your solution is actually quite nice.

 

> In your position I might try doing hiera('myclass::data', fail()) to mimic 
> a class parameter with no default, in case there was no sensible default 
> and catalog compilation should fail without this data. If I recall 
> correctly, a failed hiera*() lookup function just means a variable set to 
> undef. That's if a default isn't fine, of course. 
>

This one is useful, thanks!

 

> Of course, maybe the disparate syslog infrastructure is a sign that things 
> have become tangly and you need to prune syslog listeners a bit? Or, to 
> rephrase, maybe spend the time correcting your syslog infrastructure rather 
> than dealing with it in puppet? 
>

Forget the word syslog please, the example is fictitious.
It was meant to illustrate a more general problem, but as it seems it was 
probably not the best approach I could have taken :)

b.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ec5303ea-97f2-4cdd-8a04-9e9a90f5c1ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to