PostgreSQL streaming replication

This sets up a 'hot standby' PostgreSQL secondary with streaming replication. This is the closest thing to MySQL bin log replication.

Depends on https://github.gds/gds/pp-deployment/pull/356

## This includes
- Add and configure a postgres secondary
- Add replication config to postgres primary
- Factor out postgres stuff into it's own module
- Add a script to initialise a new secondary

## This does not include
- Metrics for a postgres server (we currently do not have this for our primary)
- Metrics for posgres replication
- Monitoring / alerting for a postgres server
- Monitoring / alerting for postgres replication status
- Machine creation

## Reference
https://wiki.postgresql.org/wiki/Binary_Replication_Tutorial - general replication tutorial
https://wiki.postgresql.org/wiki/Hot_Standby - documents the `pg_basebackup` command
https://wiki.postgresql.org/wiki/Streaming_Replication - more detailed docs on streaming replication
As soon as we do we should switch it though. Definitely a common pattern,
look at GOV.UK


On 19 August 2014 12:03, Rob Young <notifications@github.com> wrote:

> In modules/pp_postgres/manifests/primary.pp:
>
> > @@ -0,0 +1,31 @@
> > +class pp_postgres::primary(
> > +  $stagecraft_password,
> > +) {
> > +  include("pp_postgres::server")
> > +  include("pp_postgres::backup")
>
> Yes, we can't guarantee that the secondary is completely up to date.
> Especially considering we don't have any monitoring on replication lag.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/alphagov/pp-puppet/pull/555/files#r16407925>.
>