On Monday, April 8, 2013 4:10:03 PM UTC-5, Shantanu wrote:
>
>
> The parameterized classes guide mentions that a parameterized class is 
> declared using following syntax [1]:
>
>     class {'classname': }
>
>
> But the puppetlabs postgresql 
> module<https://github.com/puppetlabs/puppet-postgresql#setup>mentions that a 
> parameterized class '
> postgresql::server<https://github.com/puppetlabs/puppet-postgresql/blob/master/manifests/server.pp>'
>  
> can be declared using 'include' syntax [2]. 
>
> So is 'include' syntax supported for parameterized classes now?
>
>
The 'include' function has always worked with parameterized classes.  It 
just doesn't bind any parameter values to the named class.  Indeed, the 
parameterized-style class declaration syntax is better viewed as a *parameter 
binding* syntax, with a side effect of declaring the class.  That makes it 
a lot easier to understand its constraints -- principally, that if a 
parameterized-style class declaration is used, for a given class then it 
must be the first declaration of that class that is evaluated. (Any number 
of 'include' declarations may be used for the same class.)

Using the 'include' function with parameterized classes makes especial 
sense when relying exclusively on Puppet 3's automated hiera-based data 
binding, because there is nothing but downside to using empty 
parameterized-style class declarations.

Note, too, that you can use (empty) parameterized declarations for 
UNparameterized classes.  But don't do that.


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 [email protected].
To post to this group, send email to [email protected].
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