On Sun, Feb 10, 2013 at 9:32 AM, Keith Burdis <ke...@burdis.org> wrote:
> Have you looked at using hiera [1] for your configuration? It is very good
> for cascading defaults with more specific config at the top of the hierarchy
> and the least specific at the bottom. It is part of Puppet 3 and an add on
> for 2.7.

Yes, I have looked at it. My problem with Hiera is that it resides completely
outside of Puppet's DSL and is arguably pretty orthogonal to the parameterized
classes API. I like parameterized classes precisely because they are
dynamic. IOW, I can have my ENC instantiate classes with particular
parameters depending on any criteria I want *without* affecting anything
else on the system. If I want my cluster instantiated during odd numbered
hours to have auth => 'simple' and the rest auth => 'kerberos' -- that's
just ENC's job. If I want to pull off that same trick with Hiera --
I'm essentially
signing up to change a bunch of global variables that can potentially
affect my entire site.

That said, I'm starting to suspect that any solution to my problem that can
be hidden inside of parsing step has to either be parsing order dependent
(yuk!) or it has to rely on some global state that is guaranteed to be
consistent
before the parser takes over. Hiera fits that description, but it is too global.
Perhaps I can simply teach my ENC to spew out the top-level parameter
called cascading_defaults which would be a hiera-like hash for looking up
those very same values. Then my params class could be made rewritten as:
     class cluster::hdfs::params {
          auth = hlookup('auth', $::cascading_defaults, ['cluster',
'hdfs'], 'simple')
      }

Does it make sense?

Thanks,
Roman.

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to