Hi Eirik, I can't speak for those antique 2.x/3.x versions ;-)
The automatic parameter lookup feature is available from Puppet 4.8 onwards, see the official description of it here <https://puppet.com/docs/puppet/6.0/hiera_automatic.html>. As you can see from the documentation, setting parameter defaults is evaluated as Step 3, which comes after Hiera. You could only overrule Hiera if you provided parameters directly to the resource-like declaration as described in Step1. -Kevin On Thursday, October 18, 2018 at 1:57:41 PM UTC+2, Eirik Øverby wrote: > > > class foo:bar( > > $param1, # This enables you to provide 'param1' when > instantiating the class, > > # and it enables auto-parameter-lookup for > foo::bar::param1 in Hiera. > > # if no value is given or found in Hiera, the value of > $param1 will be undef. > > > > $param2='test' # This enables you to provide 'param2' when > instantiating the class, > > # and it enables auto-parameter-lookup for > foo::bar::param2 in Hiera. > > # if no value is given or found in Hiera, the value of > $param2 will be 'test'. > > ) { ... } > > > > In other words, specifying =<some value> after a parameter in the class > parameter definition, will enable you to provide a default value that is > used as a last resort. > > Really? We just had to modify about 20 classes in our end because the > hiera values were *not* used when defaults were specified in the class > definitions.. Is there some obscure option/setting we've inherited from > puppet2/3 that we're being bitten by? > > And to Chadwick - sorry for the apparently bad advice :-) > > /Eirik -- 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/379bbfd4-7688-4806-9145-592614264ead%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.