Puppet Class: profile::wmcs::services::toolsdb_primary

Defined in:
modules/profile/manifests/wmcs/services/toolsdb_primary.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • socket (Stdlib::Unixpath) (defaults to: lookup('profile::wmcs::services::toolsdb::socket', {default_value => '/var/run/mysqld/mysqld.sock'}))
  • rebuild (Boolean) (defaults to: lookup('profile::wmcs::services::toolsdb::rebuild', {default_value => false}))
  • primary_server (Optional[Stdlib::Fqdn]) (defaults to: lookup('profile::wmcs::services::toolsdb::rebuild_primary'))
  • secondary_server (Optional[Stdlib::Fqdn]) (defaults to: lookup('profile::wmcs::services::toolsdb::rebuild_secondary'))


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
# File 'modules/profile/manifests/wmcs/services/toolsdb_primary.pp', line 2

class profile::wmcs::services::toolsdb_primary (
    Stdlib::Unixpath $socket = lookup('profile::wmcs::services::toolsdb::socket', {default_value => '/var/run/mysqld/mysqld.sock'}),
    Boolean $rebuild = lookup('profile::wmcs::services::toolsdb::rebuild', {default_value => false}),
    Optional[Stdlib::Fqdn] $primary_server = lookup('profile::wmcs::services::toolsdb::rebuild_primary'),
    Optional[Stdlib::Fqdn] $secondary_server = lookup('profile::wmcs::services::toolsdb::rebuild_secondary'),
) {
    require profile::wmcs::services::toolsdb_apt_pinning

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

    class { 'profile::mariadb::monitor::prometheus':
        socket      => $socket,
    }

    # This should depend on labs_lvm::srv but the /srv/ vols were hand built
    # on the first two toolsdb VMs to exactly match the physical servers.
    # New ones should directly use that profile so we can add it here.
    file { '/srv/labsdb':
        ensure => directory,
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    file { '/srv/labsdb/binlogs':
        ensure => directory,
        mode   => '0755',
        owner  => 'mysql',
        group  => 'mysql',
    }

    class { 'mariadb::config':
        config        => 'role/mariadb/mysqld_config/tools.my.cnf.erb',
        datadir       => '/srv/labsdb/data',
        basedir       => $profile::mariadb::packages_wmf::basedir,
        tmpdir        => '/srv/labsdb/tmp',
        ssl           => 'puppet-cert',
        binlog_format => 'ROW',
        read_only     => 'ON',
        socket        => $socket,
    }

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

    if $rebuild {
        rsync::quickdatacopy { 'srv-labsdb-backup1':
            ensure      => present,
            auto_sync   => false,
            source_host => $primary_server,
            dest_host   => $secondary_server,
            module_path => '/srv/labsdb',
        }
    }
}