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: hiera('profile::mariadb::proxy::master::primary_name'))
  • primary_addr (Any) (defaults to: hiera('profile::mariadb::proxy::master::primary_addr'))
  • secondary_name (Any) (defaults to: hiera('profile::mariadb::proxy::master::secondary_name'))
  • secondary_addr (Any) (defaults to: hiera('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
24
# File 'modules/profile/manifests/mariadb/proxy/master.pp', line 2

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

    # this template is for stretch/HA1.7, may not work on earlier/later versions
    $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/lib/nagios/plugins/check_haproxy --check=failover',
        notes_url    => 'https://wikitech.wikimedia.org/wiki/HAProxy',
    }
}