Puppet Class: profile::maps::osm_replica

Defined in:
modules/profile/manifests/maps/osm_replica.pp

Overview

Parameters:

  • master (Any) (defaults to: hiera('profile::maps::osm_replica::master'))
  • replication_pass (Any) (defaults to: hiera('postgresql::slave::replication_pass'))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'modules/profile/manifests/maps/osm_replica.pp', line 1

class profile::maps::osm_replica(
    $master = hiera('profile::maps::osm_replica::master'),
    # check_postgres_replication_lag script relies on values that are only
    # readable by superuser or replication user. This prevents using a
    # dedicated user for monitoring.
    $replication_pass = hiera('postgresql::slave::replication_pass'),
) {
    require ::profile::maps::postgresql_common

    class { '::postgresql::slave':
        master_server => $master,
        root_dir      => '/srv/postgresql',
        includes      => 'tuning.conf',
    }

    class { 'postgresql::slave::monitoring':
        pg_master   => $master,
        pg_user     => 'replication',
        pg_password => $replication_pass,
        critical    => 16777216, # 16Mb
        warning     => 2097152, # 2Mb
    }

    $prometheus_command = "/usr/bin/prometheus_postgresql_replication_lag -m ${master} -P ${replication_pass}"
    cron { 'prometheus-pg-replication-lag':
        ensure  => present,
        command => "${prometheus_command} >/dev/null 2>&1",
    }

}