On Sun, Jan 15, 2012 at 12:42 AM, Alessandro Franceschi <a...@lab42.it> wrote:

>
> So, to reply to your question, Nigel, something like a hiera backend or a
> Puppet function that does what is written before in any Puppet setup would
> be what  I need.
>
> The ideal, maybe, would be a simple function that does the above and then
> if Hiera is in place, uses Hiera without requiring it: I really would like
> to reach a scenario where a person picks a single module and eventually the
> dependent modules (stdlib and so on), and can use it on his Puppetmaster
> without the need to introduce Hiera on it, if it's not already there.
> This, at least, until most of the people will have a  PuppetMaster with
> integrated Hiera ... till that moment I would like to have modules usable
> in the widest range of Puppet setups possible.
>
>
So here's the rough idea we have in place.

Parameterized class lookups are automatically consulted in a Hiera backend.

The lookup order would be as follows:

1. directly supplied value in the declaration of the class:
  class { "foo": param => "value" }

2. Hiera backend

3. Default value supplied in the definition of the class:
  class foo ($param = "value") { ... }

This would happen automatically, without requiring the use of a hiera()
like function in the class definition.

It's clear that we need to have a way for module authors to specify values
in the definition of the class.

Is this satisfied well by having the values in the manifests themselves as
in (3) above?
Or should we be encouraging authors to put a Hiera-style backend inside
their modules and have that be consulted for default values?

I'm not particularly fond of the work we're making people do around
polluting the global namespace with class-specific data.
That's something I think we should probably remove entirely, but open to
suggestions.

The primary goal here is to finally enable seamless module reuse. We've
made people jump through far too many hoops in the past.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to