Puppet Class: profile::wmcs::backup_instances

Defined in:
modules/profile/manifests/wmcs/backup_instances.pp

Overview

Parameters:

  • backup_interval (String) (defaults to: lookup('profile::wmcs::backy2::instance_backup_time'))
  • ceph_vm_pool (String) (defaults to: lookup('profile::cloudceph::client::rbd::pool'))


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/wmcs/backup_instances.pp', line 3

class profile::wmcs::backup_instances(
    String               $backup_interval = lookup('profile::wmcs::backy2::instance_backup_time'),
    String               $ceph_vm_pool    = lookup('profile::cloudceph::client::rbd::pool'),
) {
    file { '/etc/wmcs_backup_instances.yaml':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => template('profile/wmcs/backy2/wmcs_backup_instances.yaml.erb');
    }

    systemd::timer::job { 'backup_vms':
        ensure          => present,
        description     => 'Backup vms assigned to this host',
        command         => '/usr/local/sbin/wmcs-backup instances backup-assigned-vms',
        interval        => {
          'start'    => 'OnCalendar',
          'interval' => $backup_interval,
        },
        logging_enabled => true,
        user            => 'root',
    }

    systemd::timer::job { 'purge_vm_backup':
        ensure          => present,
        description     => 'purge old VM backups; allow backy2 to decide what is too old',
        command         => '/usr/local/sbin/wmcs-purge-backups',
        after           => 'backup_vms.service',
        interval        => {
          'start'    => 'OnCalendar',
          'interval' => '*-*-* 00:05:00', # daily at five past midnight
        },
        logging_enabled => true,
        user            => 'root',
    }
}