Puppet Class: profile::toolforge::elasticsearch::haproxy

Defined in:
modules/profile/manifests/toolforge/elasticsearch/haproxy.pp

Overview

Parameters:

  • elastic_settings (Elasticsearch::InstanceParams) (defaults to: lookup('profile::elasticsearch::common_settings'))
  • elastic_users (Array[Hash]) (defaults to: lookup('profile::toolforge::elasticsearch::haproxy::elastic_users'))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'modules/profile/manifests/toolforge/elasticsearch/haproxy.pp', line 1

class profile::toolforge::elasticsearch::haproxy(
    Elasticsearch::InstanceParams $elastic_settings = lookup('profile::elasticsearch::common_settings'),
    Array[Hash] $elastic_users = lookup('profile::toolforge::elasticsearch::haproxy::elastic_users'),
) {
    class { 'haproxy':
        template => 'profile/toolforge/elasticsearch/haproxy.cfg.erb',
    }

    haproxy::site { 'elastic':
        content => template('profile/toolforge/elasticsearch/haproxy-elastic.cfg.erb'),
    }

    # Allow load balancer traffic to peers on back-end ports
    $peers = join(delete($elastic_settings['cluster_hosts'], $::fqdn), ' ')
    ferm::service { 'elastic_haproxy_backend':
        proto  => 'tcp',
        port   => $elastic_settings['http_port'],
        srange => "@resolve((${peers}))",
    }

    # Allow front-end traffend to haproxy
    ferm::service { 'haproxy-http':
        proto   => 'tcp',
        port    => 80,
        notrack => true,
    }
}