Puppet Class: profile::scap::dsh

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

Overview

Class profile::scap::dsh

Installs the dsh files used by scap on a host

Parameters:

  • groups (Any) (defaults to: hiera('scap::dsh::groups'))
  • proxies (Any) (defaults to: hiera('scap::dsh::scap_proxies', []))
  • masters (Any) (defaults to: hiera('scap::dsh::scap_masters', []))
  • conftool_prefix (Any) (defaults to: hiera('conftool_prefix'))


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

class profile::scap::dsh(
    $groups = hiera('scap::dsh::groups'),
    $proxies = hiera('scap::dsh::scap_proxies', []),
    $masters = hiera('scap::dsh::scap_masters', []),
    $conftool_prefix = hiera('conftool_prefix'),
) {
    class { 'confd':
        interval => 300,
        prefix   => $conftool_prefix,
    }

    class { '::scap::dsh':
        groups       => $groups,
        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,
        }
    }
}