On Fri, 2013-08-23 at 04:50 +0000, Igor Galić wrote:
>
> ----- Original Message -----
> > Hi,
> >
> > is this puppet 3? I shall suppose it is.
> >
> > With the parameter name of "bar", you likely trigger the automagic hiera
> > lookup of foo::bar, which is (naturally) not done using hiera_array.
> > Apparently, this overrides the explicit call to hiera_array.
> >
> > I'm not sure wether that's as designed, you may want to open a bug if in
> > doubt.
>
> It is indeed puppet 3.$latest, and I shall indeed consider it a bug,
> unless it's explicitly documented to be a feature.
This really is a feature. The order that puppet3 will look for values
for parameters is as follows:
1. Explicitly passed parameters, e.g. using the class resource syntax
class {'foo': bar => 'some value'}
2. Automatic lookup of parameter values in hiera
3. Parameter default values (what you provide with $foo = ... in the
class definition.)
The reason is so that you can override class default values by providing
a value with hiera. Doing any other order simply doesn't make sense for
general use.
For example, I make a class:
class server ( $database = 'mysql' ) { ... }
include server
Then in my hiera yaml file, I set the database type to postgres instead:
server::database: postgresql
In this case, I'd expect the value from hiera to override the default
parameter value, and the server would be installed with postgres, not
mysql.
--
Calvin Walton <[email protected]>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.