Puppet Class: profile::scap::dsh

Defined in:
modules/profile/manifests/scap/dsh.pp

Summary

Installs the dsh files used by scap on a host

Overview

Parameters:

  • groups (Hash) (defaults to: lookup('scap::dsh::groups'))

    dict of dsh groups

  • proxies (Array[Stdlib::Host]) (defaults to: lookup('scap::dsh::scap_proxies', {'default_value' => []}))

    list of scap proxies

  • masters (Array[Stdlib::Host]) (defaults to: lookup('scap::dsh::scap_masters', {'default_value' => []}))

    list of scap masters



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
# File 'modules/profile/manifests/scap/dsh.pp', line 5

class profile::scap::dsh(
    Hash                $groups  = lookup('scap::dsh::groups'),
    Array[Stdlib::Host] $proxies = lookup('scap::dsh::scap_proxies', {'default_value' => []}),
    Array[Stdlib::Host] $masters = lookup('scap::dsh::scap_masters', {'default_value' => []}),
) {

    $instances = {
        'main' => {
            'interval' => 300,
        },
    }
    class { 'profile::confd':
        instances => $instances,
    }

    $scap_targets = {
        'scap_targets' => {
            'hosts' => (wmflib::class::hosts('mediawiki::scap') + wmflib::resource::hosts('scap::target')).sort.unique,
        },
    }
    class { 'scap::dsh':
        groups       => $groups + $scap_targets,
        scap_proxies => $proxies,
        scap_masters => $masters,
    }

    # Special-case file for the MediaWiki canaries
    # These need to change according to the MediaWiki active datacenter.
    # We also want the servers from each cluster in their own canary list.
    $canary_dcs = ['eqiad', 'codfw']
    $canary_clusters = ['appserver', 'api_appserver', 'jobrunner', 'parsoid']

    $canary_clusters.each |$cl| {
        # Cosmetic fix to get the same filenames as before
        $dsh_name = $cl ? {
            'api_appserver' => 'api',
            default => $cl
        }
        # We also need mediawiki-config to get the active DC.
        $keys = $canary_dcs.map |$dc| { "/pools/${dc}/${cl}/canary" } + '/mediawiki-config'
        confd::file { "/etc/dsh/group/mediawiki-${dsh_name}-canaries":
            ensure     => present,
            content    => template('profile/scap/dsh-mediawiki-canaries.tpl.erb'),
            watch_keys => $keys,
        }
    }
}