Ansible role for borgbackup
None
Available variables are listed below, along with default values (see defaults/main.yml
):
# borg help compression
borg_compression: lz4
# partialy implemented
# https://borgbackup.readthedocs.io/en/stable/usage/init.html
# borg help init
borg_encryption: none
# https://borgbackup.readthedocs.io/en/stable/usage/general.html
borg_remotes:
default:
# required
path: 'ssh://example.org'
# optional
compression: "{{ borg_compression }}"
# Todo handle it
encryption: "{{ borg_encryption }}"
# may be string
db: /path/to/folder
borg_backups:
-
# require
name: minimal
from:
- /path/to/from_folder #
dest: "{hostname}_minimal"
-
# require
name: example
from:
- "-" # for stdin
- /path/to/from_folder # also can add file
dest: "{hostname}_db_{now:%Y-%m-%dT%H:%M:%S}"
#optional
stdin_name: dump.sql
# By default - true
before_command: >- # Must be no line!
/usr/local/bin/command_to_stout_backup
# defaults
workdir: '$HOME' # For add to archive by relative path
remote: db
user: "{{ ansible_ssh_user }}"
cron:
# By default every day
minute: "0"
hour: "1"
day: "*"
month: "*"
weekday: "*"
prune: true
cron:
# https://crontab.guru/
# By default every day
minute: "0"
hour: "0"
day: "*"
month: "*"
weekday: "*"
# https://borgbackup.readthedocs.io/en/stable/usage/prune.html
prefix: null
glob: null
keep:
# https://crontab.guru/
secondly: null
minutely: null
hourly: 24
daily: 14
weekly: 8
monthly: -1
#
delete: false
- hosts: all
roles:
- role: apkawa.borg
MIT
Apkawa
- Install docker
- Install pipenv
- Initialize pipenv:
pipenv install --dev
- Run tests
pipenv run -- tox -e centos7
- pipenv shell
molecule converge
molecule idempotence
molecule verify
for run Testinfra