Recently, I have been working on developing a few Puppet modules. When I started using puppet-lint to perform linting on my code, and puppet strings to generate documentation, I encountered related issues. To ensure that these issues were not specific to my project, I cloned Puppet’s ntp module, which is frequently used by the examples in Puppet’s documentation. I was able to reproduce both issues.
ERROR: ntp not in autoload module layout on line 203
At first I thought I was encountering an issue using puppet-lint within Atom. But, when I tried to generate my module’s documentation, I received a warning stating the documentation for my base class was missing.
After confirming my class in init.pp had been named correctly, and confirming the yard-style comments were present, I attempted to build the documentation for Puppet’s ntp module. I was shown a similar warning:
[warn]: Missing documentation for Puppet class 'ntp' at manifests/init.pp:203.
Modules: 0 ( 0 undocumented)
Classes: 0 ( 0 undocumented)
Constants: 0 ( 0 undocumented)
Attributes: 0 ( 0 undocumented)
Methods: 0 ( 0 undocumented)
Puppet Classes: 4 ( 1 undocumented)
Puppet Types: 0 ( 0 undocumented)
Puppet Defined Types: 0 ( 0 undocumented)
Puppet Providers: 0 ( 0 undocumented)
Puppet Functions: 0 ( 0 undocumented)
Both issues seemed to be caused by problems mapping the class name in init.pp to the name of the module itself. I realized that both of these modules were stored in directories based off of the names of their git repositories, and changed their names to match the name of the modules within.
puppetlabs-ntp → ntp
puppet-cntlm → cntlm
puppet strings worked as expected.
Considering many Puppet module repository names do not match the name of the corresponding module, I am surprised that these tools do not assume that the name of the module matches the name of the class in init.pp.