Puppet Class: profile::mariadb::cloudinfra

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

Overview

Parameters:

  • master (Boolean) (defaults to: lookup('profile::mariadb::cloudinfra::master'))
  • puppetmasters (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::mariadb::cloudinfra::puppetmasters'))
  • enc_servers (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::mariadb::cloudinfra::enc_servers'))
  • cloudinfra_dbs (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::mariadb::cloudinfra::cloudinfra_dbs'))


1
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
# File 'modules/profile/manifests/mariadb/cloudinfra.pp', line 1

class profile::mariadb::cloudinfra (
    Boolean $master = lookup('profile::mariadb::cloudinfra::master'),
    Array[Stdlib::Fqdn] $puppetmasters  = lookup('profile::mariadb::cloudinfra::puppetmasters'),
    Array[Stdlib::Fqdn] $enc_servers    = lookup('profile::mariadb::cloudinfra::enc_servers'),
    Array[Stdlib::Fqdn] $cloudinfra_dbs = lookup('profile::mariadb::cloudinfra::cloudinfra_dbs'),
) {
    if debian::codename::ge('bullseye') {
        # for bullseye and newer (cloudinfra-db03+), use a Cinder volume for MariaDB storage
        include ::profile::labs::cindermount::srv
    }

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

    ferm::service { 'enc-clients':
        proto   => 'tcp',
        port    => 3306,
        notrack => true,
        srange  => "(@resolve((${puppetmasters.join(' ')} ${enc_servers.join(' ')})))",
    }

    ferm::service { 'mariadb_replication':
        proto   => 'tcp',
        port    => 3306,
        notrack => true,
        srange  => "(@resolve((${cloudinfra_dbs.join(' ')})))",
    }

    require profile::mariadb::packages_wmf
    include profile::mariadb::wmfmariadbpy
    class { 'mariadb::service': }

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

    class { 'mariadb::heartbeat':
        datacenter => $::site,
        enabled    => $master,
    }
}