Borg backup role
Go to file
Luc Stroobant 89085c5d17 prepend all vars with role name 2017-10-01 13:05:59 +02:00
defaults prepend all vars with role name 2017-10-01 13:05:59 +02:00
meta meta data 2017-09-08 16:50:11 +02:00
tasks prepend all vars with role name 2017-10-01 13:05:59 +02:00
templates prepend all vars with role name 2017-10-01 13:05:59 +02:00
LICENSE.md license 2017-09-08 20:23:21 +02:00
README.md prepend all vars with role name 2017-10-01 13:05:59 +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.

Required variables

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

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:

borgbackup_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 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/