Include Augeas

The official elasticsearch puppet module uses Augeas to fiddle with
system defaults for elasticsearch. We need to include it in bootstrap vs
in our puppet modules because puppet expects it to exist before it runs
to enable the augeas resource provider.
Elasticsearch to official module and new version

The GDS module we were using has been deprecated and moved into the
attic and we have been meaning to move to it for a while.

The new module has the concept of a central installation with 1 or more
instances that are running on the node. We have configured 1 instance
with the same configuration as our existing elasticsearch setup.

The empty hash for the config param to the ::elasticsearch class is
there to stop it being a string, which blows up puppet.

We have included the apt repo in our manifest vs using manage_repo as
the later caused a dependency cycle in our code.

Templates need to be included when the instances are setup as they will
curl their configuration into the instance and if it is not setup and
running it will break.
Add logs-elasticsearch-3 to cluster_hosts

Not sure why it wasn't there and probably should have been.
Change path to elasticsearch log for OOM check

Given the new way the official elasticsearch module structures instances
of elasticsearch our logs have changed location. This starts tailing the
correct location.
Update kibana version

The version we were using is no longer compatible with the newer version
of elasticsearch. This updates the version and cleans up some of the
code in the performanceplatform::kibana class.
Remove the erasure of the elasticsearch rotate

As we have started with fresh boxes this no longer needs to be here.
Include estools

The deprecated elasticsearch module used to include these tools. We
still need them to rotate out our indices so we should install them
ourselves.

This relies on the following PR being merged:

https://github.com/alphagov/estools/pull/7

As the old version of pyes used by the tools had issues.
Roll elasticsearch logs based on size

log4j, the underlying elasticsearch logging library, can't roll logs
daily and remove some after a certain date. Using a rolling file
appender and limited on the size of logs gives us both the ability to
remove and ensures that our logs do not blow up our disk if something
gets over excited.
Merge pull request #632 from alphagov/feature/new-elasticsearch

Feature/new elasticsearch
Remove phantom cleanup
Merge pull request #637 from alphagov/remove-phantom-cleanup

Remove phantom cleanup
Add missing logs-elasticsearch-3 to box checks

When logs-elasticsearch-3 was created it was missed off being added to
the list of machines that monitoring-1 should watch. It should be in
this list so I have added it.
We need to support installing oracle-java-7

The logstash package expects oracle's java to be installed so our java
module needs to support all of the bumf around installing that pacakge.
Upgrade logstash to 1.4.2

We were previously running 1.1.* and a lot has changed to logstash in
the interim. The puppet module has also changed significantly so there
is quite a lot in this commit. Below is a link to the logstash changelog
for your perusal:

   https://github.com/elasticsearch/logstash/blob/master/CHANGELOG

Rabbitmq module had to be updated to handle the newer version of rabbit
and to fix some issues with initial provisioning of machines.

I have split up the old monitoring.pp into a directory with the three
main groups of configuration in it (sensu, graphite and logstash). This
was done to aid with clarity as it was getting a little gnarly in that
file having a whole heap of tenuously related configuration.

The new logstash apt package from the repo will expect oracle's version
of java to be installed so I have had to change the java module (in a
previous commit) and configure monitoring to install oracle's version.

We can no longer run two agents with the new puppet module, hopefully
the work on performance and reliability between version 1.1 and 1.4 will
mean that this is no longer needed.

We no longer need to setup a template for elasticsearch as logstash will
now manage this for us and set it up with sensible defaults.

I have installed the kopf plugin for elasticsearch, which is a better
version of the head plugin we are used to using. This has been
instrumental in helping me diagnose issues between logstash and
elasticsearch so I thought I'd include it in this commit.

In the /etc/defaults files we drop in as part of install logstash we set
its user to be root, the module would usually use a logstash user.
This is because logstash will need to bind to port
514 (syslog port) and any port beneath 1024 requires root access to
bind. I tried using setcap to allow logstash to bind to the port without
root access but because the jvm is the executable that it would need to
be applied to I decided not to as I didn't want to allow any jvm process
to bind to these ports.

I have introduced a require on in the elasticsearch_logs checks so that
it doesn't try and drop files in before the /etc/sensu directory has
been created on the server.

The monitoring::graphite class has a new resource ordering to force the
installation of ::graphite before ::nginx. This is because the ::graphite
class will install apache and reconfigure it to run on a custom port but
I had problems where nginx would be setup before apache being
reconfigured. This ended up with errors in the initial provision because
nginx couldn't bing to port 80.

All of the inputs, filters and outputs have been migrated over to files
as the new puppet-logstash module does not support the same set of
resources to setup these files.
Bump librarian-puppet version

The version we were using (1.1.3) had issues resolving module
dependencies for modules pulled in over git. The latest version seems to
have fixed this, so whoop!
Use LS_HEAP_SIZE to set logstash heap

Logstash sets a default LS_HEAP_SIZE and this is not compatible with the
way we were overriding the heap sizes.
Remove second logstash agent

This no longer exists as the new puppet-logstash module only supports
running one agent.
Merge pull request #638 from alphagov/feature/upgrade-logstash

Feature/upgrade logstash
Update sensu elasticsearch queries for new version

Our old structure of query no longer works so I have updated it.
Merge pull request #639 from alphagov/bugfix/elasticsearch-queries

Update sensu elasticsearch queries for new version