Borg backup role
Go to file
Luc Stroobant dc72e03bb3 support append_only mode 2017-10-01 19:24:50 +02:00
defaults support append_only mode 2017-10-01 19:24:50 +02:00
meta meta data 2017-09-08 16:50:11 +02:00
tasks support append_only mode 2017-10-01 19:24:50 +02:00
templates support append_only mode 2017-10-01 19:24:50 +02:00
LICENSE.md license 2017-09-08 20:23:21 +02:00
README.md support append_only mode 2017-10-01 19:24:50 +02:00
backup.yml fix hosts list 2017-10-01 12:01:28 +02:00

README.md

Borg backup role

This role installs Borg backup on backupservers and clients. The role contains a wrapper-script 'borg-backup' to ease the usage on the client. Supported options include borg-backup info | init | list | backup | mount. Automysqlbackup will run as pre-backup command if it's installed. The role supports both self hosted and rsync.net as Borg server.

It's possible to configure append-only repositories to secure the backups against deletion from the client.

Required variables

Define a group backupservers in your inventory with one or multiple hosts.

infra:
[backupservers]
backup1.fiaas.co

[borgbackup_management]
supersecurehost

group_vars/all.yml:

backupservers:
  - fqdn: backup1.fiaas.co
    user: borgbackup
    type: normal
    home: /backup/
    pool: repos
    options: ""
  - fqdn: yourhost.rsync.net
    user: userid
    type: rsync.net
    home: ""
    pool: repos
    options: "--remote-path=borg1"

Contains the list of server you want to use on a certain client. Allows to override backup servers on group or host level. WARNING: the trailing / in item.home is required.

Define a borg_passphrase for every host. host_vars\client1:

borgbackup_passphrase: Ahl9EiNohr5koosh1Wohs3Shoo3ooZ6p

Set borgbackup_appendonly: True in host or group vars if you want append-only repositories. In that case it's possible to define a hostname in borgbackup_management_station where a borg prune script will be configured.

Make sure to check the configured defaults for this role, which contains the list of default locations being backed up in backup_include. Override this in your inventory where required.

Usage

Configure Borg on the server and on a client:

ansible-playbook -i inventory/test backup.yml -l backup1.fiaas.co
ansible-playbook -i inventory/test backup.yml -l client1.fiaas.co

Further reading

https://borgbackup.readthedocs.io/en/stable/