Puppet Class: role::mariadb::misc

Defined in:
modules/role/manifests/mariadb/misc.pp

Overview

miscellaneous services clusters

Parameters:

  • shard (Any) (defaults to: 'm1')
  • master (Any) (defaults to: false)


2
3
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
73
74
75
76
77
78
# File 'modules/role/manifests/mariadb/misc.pp', line 2

class role::mariadb::misc(
    $shard  = 'm1',
    $master = false,
    ) {

    system::role { 'mariadb::misc':
        description => "Misc Services Database ${shard}",
    }

    $read_only = $master ? {
        true  => 0,
        false => 1,
    }

    $mysql_role = $master ? {
        true  => 'master',
        false => 'slave',
    }

    class { '::profile::mariadb::mysql_role':
        role => $mysql_role,
    }
    profile::mariadb::section { $shard: }

    include ::profile::standard
    include ::passwords::misc::scripts
    include ::profile::base::firewall
    ::profile::mariadb::ferm { 'misc': }
    # hack until m5 servers are bought and proxy is in use
    if $shard == 'm5' {
        include ::profile::mariadb::ferm_wmcs
    }
    include ::profile::mariadb::monitor::prometheus

    include mariadb::packages_wmf
    include mariadb::service

    class { 'mariadb::config':
        config    => 'role/mariadb/mysqld_config/misc.my.cnf.erb',
        basedir   => '/opt/wmf-mariadb101',
        datadir   => '/srv/sqldata',
        tmpdir    => '/srv/tmp',
        ssl       => 'puppet-cert',
        read_only => $read_only,
        p_s       => 'on',
    }

    class { 'profile::mariadb::grants::production':
        shard    => $shard,
        prompt   => "MISC ${shard}",
        password => $passwords::misc::scripts::mysql_root_pass,
    }

    class { 'mariadb::heartbeat':
        shard      => $shard,
        datacenter => $::site,
        enabled    => $master,
    }
    class { 'mariadb::monitor_disk':
        is_critical   => $master,
        contact_group => 'admins',
    }

    class { 'mariadb::monitor_process':
        is_critical   => $master,
        contact_group => 'admins',
    }
    mariadb::monitor_readonly { [ $shard ]:
        read_only     => $read_only,
        is_critical   => false,
        contact_group => 'admins',
    }
    mariadb::monitor_replication { [ $shard ]:
        is_critical   => false,
        contact_group => 'admins',
    }
}