Puppet inheritance of parametrized classes

puppet

I have a situation in puppet where I want to inherit from a parametrized class:

class base ($basepath) {
  ...
}

class extends_base ($ext_param) inherits base {
  ...
}

Now trying to instantiate the extends_base class I get the following error message:

Must pass basepath to Class[Base]

However, I don't see a way how to pass the basepath parameter to the Base class..
I tried to pass the param in the Class[Extends_base] definition, puppet doesn't like this either.

Best Answer

Puppet does not support inheritance with parameterized base classes, i.e. the base class must not be parameterized for inheritance to work. So what you are trying to do is currently not possible.

See here for details: http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#inheritance

Related Topic