Puppet Class: profile::mariadb::proxy::master

Defined in:
modules/profile/manifests/mariadb/proxy/master.pp

Overview

proxy in with 2 hosts, active-passive (with failover) scenario

Parameters:

  • primary_name (Any) (defaults to: lookup('profile::mariadb::proxy::master::primary_name'))
  • primary_addr (Any) (defaults to: lookup('profile::mariadb::proxy::master::primary_addr'))
  • secondary_name (Any) (defaults to: lookup('profile::mariadb::proxy::master::secondary_name'))
  • secondary_addr (Any) (defaults to: lookup('profile::mariadb::proxy::master::secondary_addr'))


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'modules/profile/manifests/mariadb/proxy/master.pp', line 2

class profile::mariadb::proxy::master (
    $primary_name   = lookup('profile::mariadb::proxy::master::primary_name'),
    $primary_addr   = lookup('profile::mariadb::proxy::master::primary_addr'),
    $secondary_name = lookup('profile::mariadb::proxy::master::secondary_name'),
    $secondary_addr = lookup('profile::mariadb::proxy::master::secondary_addr'),
    ) {

    $master_template = 'db-master.cfg.erb'

    file { '/etc/haproxy/conf.d/db-master.cfg':
        owner   => 'haproxy',
        group   => 'haproxy',
        mode    => '0440',
        content => template("profile/mariadb/proxy/${master_template}"),
    }

    nrpe::monitor_service { 'haproxy_failover':
        description  => 'haproxy failover',
        nrpe_command => '/usr/local/lib/nagios/plugins/check_haproxy --check=failover',
        notes_url    => 'https://wikitech.wikimedia.org/wiki/HAProxy',
    }
}