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 mentions that a parameterized class '
postgresql::server' 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