Class Inheritance


Inheritance may be used within a module, but must not be used across module namespaces. Cross-module dependencies should be satisfied in a more portable way that doesn’t violate the concept of modularity, such as with include statements or relationship declarations (style guide).

What you have done

class ssh inherits server { }

class ssh::client inherits workstation { }

class wordpress inherits apache { }

What you should have done:

class ssh { }

class ssh::client inherits ssh { }

class ssh::server inherits ssh { }

class ssh::server::solaris inherits ssh::server { }

Disabling the check

To disable this check you can add --no-inherits_across_namespaces-check to your puppet-lint command line.

$ puppet-lint --no-inherits_across_namespaces-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_inherits_across_namespaces')