MCollective Plugin - FileMD5er

I’ve been watching the Marionette Collective for a while, and even gave it a small trial in a couple of testing environments, but this weekend was the first time I’ve experimented with it at a slightly larger scale (just over a hundred small VM nodes - you have to love EC2) and I’m still impressed.

I can see how it’s going to make parts of my work flow easier, and in an attempt to learn a little more about how the plugin system works under the hood I decided to write a small agent, FileMD5er. The agent itself is very simple and addresses a small annoyance I’ve scripted around for a while. When you’re bringing files under Puppet (or Chef) management you need to dig through the hosts and locate any files with differences compared to the most common adhoc file. With a quick mc-filemd5er /path/to/file I can easily spot any machines that have a slightly different version of the file, and then fold them in to centralised management.

Writing the plugin itself was quite easy. The two problems I encountered were finding the right generation of existing plugin to crib from (some of the official MCollective Plugins are of a newer format than others) and not naming the class and the .rb file the same name. Which caused it to half work.

I’ll be putting more of my MCollective Plugins on Github as the become a little more generic and hopefully useful to someone else.