bob/roles/restic
Marty Oehme cd842ea4b5
Add hostname to restic containers
Will pass through the hostname to any snapshots set up.
The hostname is _not_ derived from the random docker container string
but instead takes the name of the _host_ on which docker is running
(from ansible facts).

The hostname in combination with the tag should point to the correct
host -> stack which is being backed up.
2025-07-18 21:37:07 +02:00
..
defaults restic: Add notification 2025-07-18 21:37:05 +02:00
meta restic: Add stack 2025-07-18 21:37:03 +02:00
tasks restic: Add stack 2025-07-18 21:37:03 +02:00
templates Add hostname to restic containers 2025-07-18 21:37:07 +02:00
vars restic: Add stack 2025-07-18 21:37:03 +02:00
README.md restic: Add notification 2025-07-18 21:37:05 +02:00

restic

Backup maintenance stack.

Takes care of regularly pruning the backup repository and checking its integrity. Supports any restic backend. Variables set here are used in other roles to individually configure their backups.

Defaults

restic_tz: US/Chicago

The timezone to be used for any cronjobs. Inherits from the global timezone variable or can be set individually.

restic_version: latest

The docker image version to be used in stack creation.

restic_repo: s3.eu-central-1.wasabisys.com/myrepo
restic_pass: <restic-pass>

The repository url and the restic repository password. Can be of any type restic supports (e.g. /path/to/backups for local, s3:address.to.s3.com for S3, etc.) See the restic documentation for more information.

restic_s3_key: <s3-key>
restic_s3_secret: <s3-secret>

The restic S3 credentials, i.e. the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

restic_prune_cron: 0 0 4 * * *
restic_forget_args: --prune --keep-last 14 --keep-daily 2 --keep-weekly 2

The default prune and forget cronjob schedule and arguments: Prune the repository every day at 4:00 AM and keep the last 14 snapshots, 2 daily snapshots and 2 weekly snapshots. Be aware that go-cron has an extra field in the front for seconds compared to many other implementations.

restic_check_cron: 0 15 5 * * *
restic_check_args: --read-data-subset=5%

The default check cronjob schedule and arguments: Check the repository integrity every day at 5:15 AM and in addition to structural checks, read 5 randomly chosen % for a data integrity check.

restic_notify_success:
restic_notify_failure:
restic_notify_exit:

If restic should notify the user on success/failure/exit (i.e. any outcome process finish). Defaults to no notifications. Uses Apprise and thus takes an apprise URL in the form of ntfy://my-ntfy-channel. Setting one of these configures both the prune and the check to notify the user if either is done, so currently any success (failure/exit) notification would be doubled for each sucess (failure/exit).