Puppet Class: profile::cache::varnish::frontend::text

Defined in:
modules/profile/manifests/cache/varnish/frontend/text.pp

Summary

profile to configure varnish frontend text nodes

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • esitest_ensure (Wmflib::Ensure) (defaults to: lookup('profile::cache::varnish::frontend::text::esitest_ensure'))

    ensureable parameter for esitest



4
5
6
7
8
9
10
11
12
13
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'modules/profile/manifests/cache/varnish/frontend/text.pp', line 4

class profile::cache::varnish::frontend::text (
    Wmflib::Ensure $esitest_ensure = lookup('profile::cache::varnish::frontend::text::esitest_ensure'),
) {
    # for VCL compilation using libGeoIP
    class { 'geoip': }
    class { 'geoip::dev': }

    # Include ESI testing backend service in all text nodes
    class { 'esitest':
        ensure     => $esitest_ensure,
        numa_iface => $facts['interface_primary'],
    }

    # differential privacy support: T315676
    # for VCL compilation using libsodium
    ensure_packages(['libsodium-dev'])

    # script used to generate a daily key
    ensure_packages(['python3-nacl', 'python3-pystemd']) # python dependencies
    $dp_generator_path = '/usr/local/sbin/varnish-dp-key-generator'
    file { $dp_generator_path:
        ensure => present,
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/profile/cache/varnish_dp_key_generator.py',
    }

    # master key
    $master_key_path = '/etc/varnish/dp.master.key'
    $sub_key_path = '/etc/varnish/dp.daily.key'
    file { $master_key_path:
        ensure    => present,
        owner     => 'root',
        group     => 'root',
        mode      => '0600',
        show_diff => false,
        backup    => false,
        content   => secret('varnish/dp.master.key'),
    }

    # provide an initial sub key file
    exec { "${dp_generator_path} ${master_key_path} ${sub_key_path}":
        creates => $sub_key_path,
        require => Package['python3-nacl'],
    }

    $minute = fqdn_rand(30, 'dp-key-refresh')

    systemd::timer::job { 'refresh-dp-key':
        ensure            => present,
        description       => 'Refresh DP key used by varnish daily',
        user              => 'root',
        command           => "${dp_generator_path} ${master_key_path} ${sub_key_path}",
        syslog_identifier => 'timer-refresh-dp-key',
        interval          => {
            'start'    => 'OnCalendar',
            'interval' => "*-*-* 00:${minute}:00"
        },
    }
}