Puppet Class: profile::openstack::base::galera::backup

Defined in:
modules/profile/manifests/openstack/base/galera/backup.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • back_user (String) (defaults to: lookup('profile::openstack::base::galera::backup_user'))
  • back_pass (String) (defaults to: lookup('profile::openstack::base::galera::backup_password'))


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
# File 'modules/profile/manifests/openstack/base/galera/backup.pp', line 2

class profile::openstack::base::galera::backup(
    String              $back_user             = lookup('profile::openstack::base::galera::backup_user'),
    String              $back_pass             = lookup('profile::openstack::base::galera::backup_password'),
    ) {

    include ::profile::backup::host

    file { '/srv/backups':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0600', # implicitly 0700 for dirs
    }

    file { '/etc/mysql/conf.d/dumps.cnf':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0400',
        content => "[client]\nuser=${back_user}\npassword=\'${back_pass}\'\n",
        require => Class['galera'],
    }

    # Backups older than 15 days will be deleted by the predump script before
    # the mysqldump, so a cron is not needed.
    backup::mysqlset { "db_backups_${::hostname}":
        xtrabackup       => false, # only used for method => bpipe
        per_db           => true,
        innodb_only      => true,
        binlog           => false,
        slave            => false,
        local_dump_dir   => '/srv/backups',
        password_file    => '/etc/mysql/conf.d/dumps.cnf',
        method           => 'predump',
        mysql_binary     => '/usr/bin/mysql',
        mysqldump_binary => '/usr/bin/mysqldump',
    }
}