Saturday, April 7, 2012

Slouching Toward Best Practices

I asked the fedora-admin mailing list for permission to pull example modules from the Fedora puppet repo to try refactoring them in line with best practices.

Kevin Fenzi suggests the askbot, glusterfs, and httpd as examples of simple, typical, and complex modules.

My goal is really just to become more comfy with Puppet syntax.  To figure out how to re-write things better, I have to understand how they're currently written.

I'm helped out, here, by a tool called puppet-lint, which complains bitterly about all three example modules.  (Though, I will say, Kevin's right about the order.  The fewest complaints are about askbot, the most about httpd.)

After some work, I've substantially reduced the whining, but not yet eliminated it.  Anyone who wants to look at my progress can clone git://github.com/jsh/fedora-infrastructure and look at the modules subdirectory.

The "before" and "after" pictures are in the master and bestpractices branches, respectively.