Our docs and Puppet Forge teams have put together a beginner's guide to writing modules that just about anyone writing Puppet modules will find useful. It starts with great advice on how to plan and design your module, then moves on to advice on how to design its classes and parameters, how to order its classes, and how to leverage and utilize dependencies.
There are also sections on module testing with tools like rspec-puppet, rspec-system, and puppetlabs-spec-helper, module versioning and releasing modules. Finally, there's a good list of community resources you can use to get help, including recommended books and links to module documentation.
The new guide really puts it best:
Contributors to this guide have spent years creating Puppet modules, falling into every pitfall, trap, and mistake you could hope to make. This guide is intended to help you avoid our mistakes through an approachable introduction to module best practices.
- The Puppet Forge is our online collection of 1,600+ Puppet modules that help you get started automating your IT infrastructure right away.
- Learn how modules from the Puppet Forge help you move toward software-defined infrastructure.
- Don't miss this recent podcast on module testing best practices.