/
/
/
Ansible role that can run restic backups and push it to a remote storage server.
1---
2# List of services (Compose projects) to back up, processed sequentially.
3# "path" is the directory containing docker-compose.yml (project_src).
4# "targets" are host paths to include in the restic backup for THIS project.
5# If omitted, the role will back up the project directory itself.
6backup_services:
7 # - name: app1
8 # path: /opt/stacks/app1
9 # project_name: app1 # optional; defaults to basename(path)
10 # compose_files: [] # optional; list of file names if not standard
11 # targets:
12 # - /opt/stacks/app1 # default if omitted
13 # - /srv/data/app1
14 # pre_cmd: [] # optional shell commands (host) before stop
15 # post_cmd: [] # optional shell commands (host) after start
16
17# Restic repository configuration (set in inventory or vault)
18restic_repo: "" # e.g. "sftp:user@backup:/repos/host1" or "b2:bucket:path"
19restic_password: "" # vault this
20restic_env_extra: {} # e.g. { AWS_ACCESS_KEY_ID: "...", AWS_SECRET_ACCESS_KEY: "..." }
21# restic_environment will be generated dynamically in tasks
22
23# Restic CLI arguments & retention policy
24restic_backup_args: "--one-file-system"
25restic_tag_format: "{{ item.name | default((item.path | basename)) }}"
26restic_retention_enable: true
27restic_retention_args: "--keep-daily 7 --keep-weekly 4 --keep-monthly 6"
28
29# Health checks
30backup_health_check: true
31backup_health_timeout_sec: 600
32backup_health_interval_sec: 5
33
34# Package installation
35backup_install_restic: true # install restic via apt on Debian/Ubuntu
36backup_restic_pkg_name: restic
37
38