Cryptocracy

A blog

Chef MCollective cookbook, v0.9.0

After far too long, I’ve released an updated cookbook for installing MCollective which addresses the three issues called out in the original announcement:

  1. Directly invoking Ohai as a fact source is pretty slow.
  2. The full set of Ohai facts can be pretty large.
  3. Chef doesn’t normalise ‘default’ recipe names in the expanded run list.

Ohai facts via YAML

Prior to this release, this cookbook configured MCollective to use the opscodeohai_facts plugin from the mcollective-plugins repository. While this continues to be supported, the default configuration now has MCollective loading facts from a YAML file written by a Chef report handler.

A new attribute has been added to control this – set node.mcollective.factsource to ohai to restore the old behaviour.

Configurable fact list

Out of the box, Ohai produces a lot of facts – not all of which are especially useful as MCollective Facts. The report handler responsible for building the YAML fact file looks at an attribute (node.mcollective.fact_whitelist) to filter the full list of facts available to Chef.

Default recipe name

The original responsibility of the report handler was to produce a list of “classes”, the roles and recipes Chef used on this node. Unfortunately, Chef offers two ways of referring to a cookbook’s default recipe – either with an explicit recipe name, recipe[cookbook::default], or without, recipe[cookbook].

This isn’t spectacularly helpful, as the result is the same no matter which name was used. With this release, default recipes in the classlist always use their full name.

Other Changes

Site Plugins

A separate directory is now created to hold third-party plugins. Its path is stored as an attribute, node.mcollective.site_plugins.

Recipe for Puppetlabs repo installation

The cookbook previously assumed that the user would want to install the MCollective packages from the Puppetlabs apt/yum repository. While this simplifies installation for internet-connected machines, it’s not the best approach for larger sites. If the nodes you’re configuring don’t have access to the internet, it obviously won’t work at all.

This version introduces recipe[mcollective::puppetlabs-repo], which is included by mcollective::default. If you wish to use a local package mirror for installation, make sure it has been installed before using mcollective::server and mcollective::client.

Futures

What’s left before a 1.0 release?

  • Paths to the generated facts/classes files should be controlled by a node attribute.
  • Optionally include non-automatic attributes in the fact file.
  • Support for using security plugins other than the default ‘PSK’.
  • Tests (cucumber-chef, I’m looking at you).

Where can I get it?

You can find the MCollective Cookbook on the Opscode Community site, install it using Knife (knife cookbook site install mcollective), or check out the source on github.

Comments