Puppet Class: etcd::backup

Defined in:
modules/etcd/manifests/backup.pp

Overview

Parameters:

  • cluster_name (Any) (defaults to: $::domain)
  • backup_dir (Any) (defaults to: '/srv/backups/etcd')


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'modules/etcd/manifests/backup.pp', line 6

class etcd::backup ($cluster_name=$::domain, $backup_dir='/srv/backups/etcd') {
    file { ['/srv/backups', $backup_dir]:
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    file { '/usr/local/bin/etcd-backup':
        source => 'puppet:///modules/etcd/etcd-backup.py',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
    }

    cron { 'etcdbackup':
        command => "/usr/local/bin/etcd-backup ${cluster_name} ${backup_dir}",
        user    => 'root',
        hour    => 0,
        minute  => fqdn_rand(60, 'etcd_backup'),
    }

}