mozilla-services/svcops-puppet — pull request #12 by whd (2014-01-22 05:49:39+00:00)
Title: Fix hekad module for 0.4* series hekas

The main purpose of this work is to make the heka module play nice with 0.4* series hekas.

`hekad::instance` is now the preferred way of instantiating a heka. The base class, now included by `hekad::instance`, only provides the basic scaffolding. Any host that was using `include hekad` (via hiera include) should now `include hekad::common` instead, which wraps `hekad::instance` to get the old behavior. (An aside: the name `common` is not very descriptive; perhaps there is a better name for it.) With this change we will have a consistent method for setting up a hekad, as well as ensuring the appropriate heka version is installed in all cases. Some details follow.

This implementation attempts to follow the current best practice of using a params class as set forth [here](http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html#appendix-smart-parameter-defaults), even though that idiom [may be on its way out](http://www.devco.net/archives/2013/12/09/the-problem-with-params-pp.php).

The fix to make `hekad::instance` enforce a particular heka version will resolve version mismatch failures on the webheads. In addition, the webhead hekad toml is incompatible with heka 0.4* due to the [renaming of `LoglineDecoder` to `PayloadRegexDecoder`](https://mail.mozilla.org/pipermail/heka/2013-July/000011.html); this is also addressed.

Other changes:

`hekad3` is ensured absent, as that is the current package on webheads and needs to be removed.

`hekad.json.erb` has been removed, since as we've moved to 0.4* this file is unused.

hekad's default base directory is now [/var/cache instead of /var/run](http://hekad.readthedocs.org/en/latest/configuration.html?highlight=base_dir#global-configuration-options), so those directories are ensured to exist instead of the /var/run ones for [LogfileInput](http://hekad.readthedocs.org/en/v0.4.0/configuration.html#logfileinput).