My colleague and I are maintaining a “Puppet boilerplate modules” project (something like puppet module generate on steroids). To keep up with the OSS spirit, we thought it would be a good idea to share it with the community.

The project helps you to create high quality Puppet modules in a fast and comfortable way. Main goals are to boost efficiency and Puppet code quality. Use it if you want to get module skeletons with:

Some explanatory notes

Every boilerplate comes with different manifest files, each encapsulates the Puppet code for a specific job. This ensures a clean module structure. The name of the manifest should say what it does in general, the RDoc block at the top provides more details. Example: the application-002 boilerplate comes with the following files in /manifests:

init.pp
Contains the main module class. It validates the module parameters and coordinates the actions (e.g. by chaining resources).

params.pp
Sets the default values for the parameters of the main module class (→ init.pp) and manages internal module variables. Therefore, many operating system dependent differences like package names are addressed in here.

package.pp
Coordinates all software package management related actions. Normally, there is no need to edit this file.

config.pp
Coordinates all configuration related actions. Many modules won't need this because most there is no need for a special application configuration. If so, just delete the file and thereferences in init.pp.

repo.pp
Coordinates all package repository related actions. Many modules won't need this because an additional repository is not needed to install the application. If so, just delete the file and thereferences in init.pp.

Everything you must edit/check after you generated a module is marked with a FIXME/TODO. E.g. when the package list or some class calls when using the application-002 boilerplate.

You don't need to use GitHub/Bitbucket. The DVCS repository hosting part of the wizard is completely optional.

There is always room for improvement. If you're able to add any contributions to make our project better, please let me know or discuss your thoughts right here in the comments.

Update 2012-05-30: I changed the links and text regarding the new puppet example content.

Comments

Mark

No. 1 @ 2012/05/13 15:28

This is great, just the tool I was searching for. And a perfect day to play around with it. Thanks for sharing, puppet-module generate does not work on my system (bug 11410) so finding your post really made my day :)

This is just AWESOME!! I discovered your “boilerplates” yesterday and the whole thing already saved much of my time. I think I'm going to recreate most of our modules with the help of the boilerplates when our migration from puppet 2.6 to 2.7 is finished. Kudos to you!