Puppet Class: backy2

Defined in:
modules/backy2/manifests/init.pp

Overview

Class backy2

Install backy2 and configure for backing up ceph rbd volumes to local storage

This class expects to find a ceph config in /etc/ceph/ceph.conf, which

is typically provided by profile::ceph::client::rbd

On an initial install, the database can be created with

$ sudo backy2 initdb

Parameters:

cluster_name: ceph cluster name
rados_name: ceph client username

Requires:

Sample Usage

include backy2

Parameters:

  • cluster_name (String)
  • rados_name (String) (defaults to: 'client.admin')


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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'modules/backy2/manifests/init.pp', line 21

class backy2(
    String       $cluster_name,
    String       $rados_name = 'client.admin',
    ) {

    # The upstream backy2 deb is available from
    #    https://github.com/wamdam/backy2/releases
    #
    # It targets ubuntu but installs just fine on Debian Buster.
    #
    # The dependencies are a bit incomplete, so rather than take any
    #  chances I'm enumerating them here.
    $packages = [
        'python3-alembic',
        'python3-dateutil',
        'python3-fusepy',
        'python3-mysqldb',
        'python3-prettytable',
        'python3-rados',
        'python3-rbd',
        'python3-setproctitle',
        'python3-shortuuid',
        'python3-sqlalchemy',
        'python3-lz4',
        'python3-crypto',
        'python3-pycryptodome',
    ]
    ensure_packages($packages)
    ensure_packages('backy2')
    $packages.each |String $package| {
      Package[$package] -> Package['backy2']
    }

    file {
        '/srv/backy2':
            ensure => 'directory';
        '/srv/backy2/data':
            ensure  => 'directory',
            require => File['/srv/backy2'];
        '/etc/backy.cfg':
            content   => template('backy2/backy.cfg.erb'),
            owner     => 'root',
            group     => 'root',
            mode      => '0440',
            show_diff => false,
            require   => Package['backy2'];
    }

    # Hack in a one-character fix to an upstream bug.  There is a pending
    #  pull request for this, here: https://github.com/wamdam/backy2/pull/72
    file { '/usr/lib/python3/dist-packages/backy2/meta_backends/sql.py':
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        source  => 'puppet:///modules/backy2/sql.py',
        require => Package['backy2'];
    }


}