On Friday, April 19, 2013 8:49:14 AM UTC-5, blalor wrote:
>
> On Apr 19, 2013, at 9:34 AM, jcbollinger <john.bo...@stjude.org<javascript:>> 
> wrote:
>
> Moreover, I wanted to point out that, contrary to Brian's implication, 
> automated class parameter binding is independent of whether parameters have 
> explicit default values.  If you do not bind a parameter's value via a 
> class's declaration (and you shouldn't) then Puppet attempts to look up a 
> value for it via hiera, regardless of whether an explicit default value is 
> declared by the class.  Only if the hiera lookup fails is an explicit 
> default used.
>
>
> That's kind of cool.  
>
> class foo (
>     $bar => hiera('baz', 'bap'),
> ) { }
>
> So $bar will be set to "bap" only if foo::bar and baz are not found in 
> Hiera, in that order? 
>
>

I had to study that for a minute to see what you meant, but yes, that is 
correct for Puppet 3.  Puppet 2 will differ.  Puppet 3 may perform both 
lookups even when foo::bar is found, however, even though in that case it 
doesn't use the result of the 'baz' lookup.  That could be significant 
under some circumstances, such as when using an Hiera back-end that is 
expensive to call.


John

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