Puppet Class: profile::mariadb::parsercache

Defined in:
modules/profile/manifests/mariadb/parsercache.pp

Overview

Parameters:

  • shard (Any) (defaults to: hiera('mariadb::parsercache::shard'))


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
65
66
67
68
69
70
71
72
# File 'modules/profile/manifests/mariadb/parsercache.pp', line 4

class profile::mariadb::parsercache (
    $shard = hiera('mariadb::parsercache::shard')
    ){
    $mw_primary = mediawiki::state('primary_dc')

    include ::passwords::misc::scripts
    class { 'profile::mariadb::monitor::prometheus':
        mysql_group => 'parsercache',
        mysql_shard => $shard,
        mysql_role  => 'master',
    }

    class { 'mariadb::packages_wmf': }
    class { 'mariadb::service': }

    include ::profile::mariadb::grants::core
    class { 'profile::mariadb::grants::production':
        shard    => 'parsercache',
        prompt   => 'PARSERCACHE',
        password => $passwords::misc::scripts::mysql_root_pass,
    }

    if os_version('debian == buster') {
        $mysqlbasedir = '/opt/wmf-mariadb104/'
    }
    else {
        $mysqlbasedir = '/opt/wmf-mariadb101/'
    }

    class { 'mariadb::config':
        config  => 'role/mariadb/mysqld_config/parsercache.my.cnf.erb',
        datadir => '/srv/sqldata-cache',
        tmpdir  => '/srv/tmp',
        ssl     => 'puppet-cert',
        p_s     => 'on',
        basedir => $mysqlbasedir,
    }

    class { 'mariadb::heartbeat':
        shard      => $shard,
        datacenter => $::site,
        enabled    => true,
    }
    $is_on_primary_dc = ($mw_primary == $::site)
    $contact_group = 'admins'

    class { 'mariadb::monitor_disk':
        is_critical   => $is_on_primary_dc,
        contact_group => $contact_group,
    }

    class { 'mariadb::monitor_process':
        is_critical   => $is_on_primary_dc,
        contact_group => $contact_group,
    }

    mariadb::monitor_readonly { [ $shard ]:
        read_only     => false,
        is_critical   => $is_on_primary_dc,
        contact_group => $contact_group,
    }

    mariadb::monitor_replication { [ $shard ]:
      multisource   => false,
      is_critical   => $is_on_primary_dc,
      contact_group => $contact_group,
      socket        => '/run/mysqld/mysqld.sock',
    }
}