Puppet Class: pontoon::lb

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

Overview

Parameters:

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


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'modules/pontoon/manifests/lb.pp', line 28

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'),
    }
}