Puppet Tools

This is a collection of tools I’ve collected while consulting on Puppet. They are in no particular order, but I wanted to catalogue them somewhere for safekeeping.

pre-commit Git Hook

The pre-commit hook is intended to be placed into the .git/hooks directory in any puppet project you’re working on. Usually, I put it in my git home directory so whenever I do git init on any new repo, the hook gets copied automatically. Based on the work of Ronny Roethof and Mattias Geniar, the pre-commit runs several tests on your code before allowing a commit locally. It’s not unable to be worked around, but certainly increases the code quality of whatever you are working on. Thius was from before the time of the PDK, so there was no pdk validate or pdk test unit to lean on and this was how we kept “honest’ with our code. This uses the Puppet binary, puppet-lint, and metadata-json-lint as well as some Ruby tests to execute some good sanity checks. Hope you enjoy.