Borg backup role
Go to file
Luc Stroobant c1e2d35f85 meta data
2017-09-08 16:50:11 +02:00
defaults initial commit 2017-09-07 20:35:01 +02:00
meta meta data 2017-09-08 16:50:11 +02:00
tasks initial commit 2017-09-07 20:35:01 +02:00
templates initial commit 2017-09-07 20:35:01 +02:00
README.md initial commit 2017-09-07 20:35:01 +02:00

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.

Required variables

Define a group backupservers in your inventory with one or multiple hosts. The default location where the backups will be saved is /var/backup/repos/.

infra:
[backupservers]
backup1.fiaas.co

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:

borg\_passphrase: Ahl9EiNohr5koosh1Wohs3Shoo3ooZ6p

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 playbooks/backup.yml -l backup1.fiaas.co
ansible-playbook -i inventory/test playbooks/backup.yml -l client1.fiaas.co

Further reading

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