Puppet Class: profile::wmcs::db::wikireplicas::proxy

Defined in:
modules/profile/manifests/wmcs/db/wikireplicas/proxy.pp

Overview

Parameters:

  • haproxy_vips (Hash[String,Stdlib::IP::Address::V4]) (defaults to: lookup('profile::wmcs::db::wikireplicas::vips', {default_value => {'s1' => '8.8.8.8'}}))
  • section_ports (Hash[String,Stdlib::Port]) (defaults to: lookup('profile::mariadb::section_ports'))
  • section_backends (Hash[String,Stdlib::Fqdn]) (defaults to: lookup('profile::wmcs::db::wikireplicas::section_backends', {default_value => {'s1' => 'db1.local'}}))


1
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/wmcs/db/wikireplicas/proxy.pp', line 1

class profile::wmcs::db::wikireplicas::proxy (
    Hash[String,Stdlib::IP::Address::V4] $haproxy_vips = lookup('profile::wmcs::db::wikireplicas::vips', {default_value => {'s1' => '8.8.8.8'}}),
    Hash[String,Stdlib::Port] $section_ports = lookup('profile::mariadb::section_ports'),
    Hash[String,Stdlib::Fqdn] $section_backends = lookup('profile::wmcs::db::wikireplicas::section_backends', {default_value => {'s1' => 'db1.local'}}),
) {
    $haproxy_vips.each |$sect, $ip| {
        interface::alias { "${sect}-vip":
            ipv4 => $ip,
        }
    }
    class { 'haproxy::cloud::base':
        mainfile => 'puppet:///modules/profile/wmcs/db/wikireplicas/proxy/haproxy.cfg',
    }

    file { '/etc/haproxy/conf.d/upstream-proxies.cfg':
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('profile/wmcs/db/wikireplicas/proxy/upstream-proxies.cfg.erb'),
        notify  => Service['haproxy'],
    }
    class { 'prometheus::haproxy_exporter': }
}