Puppet Class: cloudlb::haproxy::wikireplicas::backend

Defined in:
modules/cloudlb/manifests/haproxy/wikireplicas/backend.pp

Summary

generates haproxy backends for wiki replicas using confd

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • replica_types (Array[String[1]])
  • sections (Hash[String, Stdlib::Port])


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'modules/cloudlb/manifests/haproxy/wikireplicas/backend.pp', line 3

class cloudlb::haproxy::wikireplicas::backend (
    Array[String[1]]           $replica_types,
    Hash[String, Stdlib::Port] $sections,
) {
    $keys = $replica_types.map |String[1] $type| {
        $sections.keys.map |String[1] $section| { "/wikireplica-db-${type}/${section}" }
    }.flatten.sort

    confd::file { '/etc/haproxy/conf.d/wiki-replica-backends.cfg':
        prefix     => "/pools/${::site}",
        watch_keys => $keys,
        content    => template('cloudlb/haproxy/wikireplicas/backend.cfg.tpl.erb'),
        check      => '/usr/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg -f',
        reload     => '/usr/bin/systemctl reload haproxy.service',
    }
}