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.

Friday, March 30, 2012

A Nice Fedora Environments Graphic

On the Wiki.

I don't see puppet01 on the diagram, but I think that's an easier(-for-me)-to-remember synonym for lockbox01, under Support.

Thursday, March 29, 2012

Vagrant & Stack Haemer: More Tools that Look Cool

I saw Vagrant and asked around a little to see if anyone I know has tried it.  Not yet.

Ben Whaley said he'd poked at Stack Hammer, a project that seems to pal around with Puppet.  When I pointed out to him that they'd misspelled "Stack Haemer," he recommended I fork the project on GitHub, fix the spelling, and send them a pull request.

Both seem pointed at a problem I'm bumping up against: now that making VMs is easy, both on my box and in the cloud, how do I manage and keep track of them?  Puppet's a piece of that, but it ain't all of it.

Wednesday, March 28, 2012

FI Mailing List Has Lots of Traffic

When I signed up for the Fedora Infrastructure mailing list, I picked "digest."  I didn't want to have to filter individual Fedora messages in my mailbox. 

I expected to get -- I dunno -- a digest a month?  A week, maybe even?  I'm getting a couple of digests a day.  Lots of traffic.

Plus, it's a fire hose of chatter about terms and topics I know nothing about: Koji, AMPQ, SELinux, ....

It's great.  My goal is always to be the dumbest guy in my peer group.

Tuesday, March 27, 2012

Puppet-Lint and Other Toys

Random notes on puppet-related things I'm ignorant of but look worth exploring when I get a minute:

Lots of folks seem to recommend puppet-lint.

Jan Vansteenkiste has tips on integrating puppet with Jenkins, and puppet-module patterns that I should probably read through.

Tim Sharpe makes reference to a tool called rspec-puppet that I think is still over my head.

I feel farther behind every day.  Ah well.

Monday, March 26, 2012

Should the Init.pp Files Be Split Up?

Looks to me like the module/manifests/init.pp files should be broken up.

Today, they're monolithic, and hold all the class and subclass definitions for a module.

Puppet looks at all the *.pp files for a module under manifests/.  The suggested structure for this directory is that each subclass be defined in its own manifest, so that foo/manifests/init.pp defines class foo, foo/manifests/bar.pp defines class foo::bar and foo/manifests/mumble/frabitz.pp defines class foo::mumble::frabitz .

The refactor-init script in github:jsh/fedora-infrastructure creates this structure from an existing init.pp.  (My guess is it's still too simple-minded and incomplete, but it's a start.)

Unit tests are supposed to mirror this structure, and mk-manifest-unit-tests, also on GitHub, does this job.

Sunday, March 25, 2012

GitHub Repo Will Hold My Scripts

I've made a GitHub repo to hold scripts.  Who knows?  Maybe someone else will find them useful, too.  Even if not, it'll give me a nice synchronization point, so I can get them from any machine.

The URL?
git://github.com/jsh/fedora-infrastructure.git