Ask Your Question

Is allowed to inherit parametrized classes with default values ?

asked 2013-09-12 08:26:10 -0600

golja gravatar image

Based on the puppet docs with Puppet 2.7 you are not allowed to inherits a class with parameters. Citing from puppet docs website:

Puppet 2.7 does not support using parameterized classes for inheritable base classes. The base class must have no parameters.

however if you look at the puppetlabs-ntp module which supports puppet 2.7+ the structure is as follow:

class ntp::params { ... }
class ntp(p0=$ntp::params:v1, ..., pN=$ntp::params:vN) inherits ntp::params { ... }
class ntp::install inherits ntp { .... }
class ntp::service inherits ntp { ... }
class ntp::config inherits ntp { ... }

That is obviously not following the limitations ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-12 08:31:12 -0600

golja gravatar image

updated 2013-09-12 08:32:45 -0600

My only logical explanation to that is puppet let you inherits a parametrized class as long all the parameters have a default value.

If that's the case puppet doc should be updated accordingly ?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-09-12 08:26:10 -0600

Seen: 231 times

Last updated: Sep 12 '13