Puppet Class: pontoon::lb

Defined in:
modules/pontoon/manifests/lb.pp

Overview

Parameters:

  • services_config (Hash[String, Wmflib::Service])


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'modules/pontoon/manifests/lb.pp', line 32

class pontoon::lb (
    Hash[String, Wmflib::Service] $services_config,
) {
    $names = pontoon::service_names($services_config)
    $t = $services_config.map |$service_name, $config| {
        $hosts = pontoon::hosts_for_role($config['role'])

        [
            $service_name,
            {
                'names'           => $names[$service_name],
                'port'            => $config['port'],
                'hosts'           => $hosts,
                'backend_use_tls' => $config['encryption'],
            }
        ]
    }

    $services = Hash($t)
    $ports = unique($services.map |$name, $svc| { $svc['port'] })

    haproxy::site { 'pontoon_lb':
        content => template('pontoon/haproxy.lb.erb'),
    }

    file { '/etc/dnsmasq.d/pontoon-lb.conf':
        content => "listen-address=${facts['ipaddress']}",
        notify  => Exec['dnsmasq-restart'],
    }

    ferm::service { 'pontoon-lb-dns-udp':
        proto   => 'udp',
        notrack => true,
        port    => 53,
    }

    ferm::service { 'pontoon-lb-dns-tcp':
        proto   => 'tcp',
        notrack => true,
        port    => 53,
    }
}