Puppet Class: esitest

Defined in:
modules/esitest/manifests/init.pp

Overview

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • numa_iface (String) (defaults to: 'lo')


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'modules/esitest/manifests/init.pp', line 14

class esitest(
    Wmflib::Ensure $ensure = 'present',
    String         $numa_iface = 'lo',
) {
    # esitest is implemented using the haproxy package, but not the haproxy
    # puppet module.  The haproxy module has a different model of sharing
    # between site-level configs with a single daemon, and what we want here is
    # a completely independent daemon instance with its own custom config and
    # runtime paths.
    systemd::tmpfile { 'esitest':
        content => 'd /run/esitest 0775 root haproxy',
    }

    # /etc/haproxy is created by the haproxy class as long as that is included
    # we will get an autorequire added to this resource
    file { '/etc/haproxy/esitest.cfg':
        ensure  => stdlib::ensure($ensure, 'file'),
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        content => template('esitest/esitest.cfg.erb'),
        require => Systemd::Tmpfile['esitest'],
        notify  => Service['esitest'],
    }

    systemd::service { 'esitest':
        ensure         => $ensure,
        content        => template('esitest/esitest.service.erb'),
        service_params => {'restart' => '/bin/systemctl reload esitest.service'},
        require        => [
            Systemd::Tmpfile['esitest'],
            File['/etc/haproxy/esitest.cfg'],
        ]
    }
}