jprltsnz.borgmatic
BorgBackup with borgmatic Client
This setup helps you use borgmatic to create backups for different applications. You can also choose to add encryption and compression. It works on Debian/Ubuntu and CentOS/Red Hat systems.
This role is mainly based on https://github.com/borgbase/ansible-role-borgbackup, but offers more flexibility and does not support borgbase.
Requirements
Before using this role, make sure the repositories
parent directory from borgmatic_configs exists. If it doesn't, the setup will not work.
Role Variables
borgmatic_init_encryption
: This controls the encryption method. For details, see https://torsion.org/borgmatic/docs/how-to/set-up-backups/#initialization. By default, it's set tonone
.borgmatic_timer
: Specifies theOnCalendar
value for theborgmatic.timer
.borgmatic_configs
: This is a dictionary containing the configuration for each application. It is copied directly to the borgmatic config folder. This setup is tailored for backing up applications individually. For all config options, visit https://torsion.org/borgmatic/docs/reference/configuration/.
Dependencies
This role needs geerlingguy.repo-epel
to be installed. It will be called automatically when required.
Example Playbook
- name: Converge
hosts: all
tasks:
- name: "Include borgmatic"
include_role:
name: jprltsnz.borgmatic
vars:
borgmatic_configs:
backup-etc:
location:
source_directories:
- /etc
repositories:
- /srv/backup_etc
atime: false
exclude_patterns:
- icon_cache
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 12
backup-home:
location:
source_directories:
- /home
repositories:
- /srv/backup_home
atime: false
exclude_patterns:
- icon_cache
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 12
License
MIT