On 09/04/2014 06:10 PM, jcbollinger wrote:
>     You may need to define local versions of them that equal the param
>     or default to the param.
> 
>     $var = $::class::params::var
> 
> 
> 
> Note that the point of the pattern of inheriting params classes is only
> to ensure that the inherited class is evaluated before the inheriting
> class, so that you can rely on the variables in question to have been
> defined in time for use as parameter defaults for the inheriting class. 
> There is no other good reason to use it.

Specifically, using it in any other context is likely plain wrong.

(Note that I've never been a user or proponent of the "inherit params
class" pattern, but it has long been the only safe choice for people who
like params class style definitions of default values - I acknowledge that.)

Since the variables from the params class are expected to be used only
as default values, the module interface will usually allow the node to
override them by specifying other values to the inheriting class, either
through
1) resource style class declaration or
2) binding of Hiera values.

When using values from the  params class in other contexts, such as
defined types, those contexts will assume that those defaults are in
effect for the current node, which is no safe assumption.

Felix

-- 
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/5416FC41.8080905%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to