This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/docker/tasks/services/restic.yml
2022-12-23 16:57:37 +01:00

64 lines
2.4 KiB
YAML

# vim: ft=yaml.ansible
---
- name: Deploy Restic with Docker Compose
docker_compose:
project_name: restic
pull: true
definition:
version: '3.8'
services:
restic_backup:
image: "mazzolino/restic:{{ services.restic.version }}"
restart: unless-stopped
environment:
RUN_ON_STARTUP: 'false'
BACKUP_CRON: '0 30 3 * * *'
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}"
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_BACKUP_SOURCES: /mnt/volumes
RESTIC_BACKUP_ARGS: >-
--tag docker-volumes
--exclude '*.tmp'
--verbose
RESTIC_FORGET_ARGS: >-
--keep-last 10
--keep-daily 7
--keep-weekly 5
--keep-monthly 12
B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}"
B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}"
TZ: "{{ timezone }}"
volumes:
- "{{ services.caddy.volume }}:/mnt/volumes/caddy:ro"
- "{{ services.nextcloud.volume }}:/mnt/volumes/nextcloud:ro"
- "{{ services.emby.volume }}/programdata:/mnt/volumes/emby/programdata:ro"
restic_prune:
image: "mazzolino/restic:{{ services.restic.version }}"
restart: unless-stopped
environment:
RUN_ON_STARTUP: 'false'
PRUNE_CRON: '0 0 4 * * *'
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}"
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_PRUNE_ARGS: >-
--verbose
B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}"
B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}"
TZ: "{{ timezone }}"
restic_check:
image: "mazzolino/restic:{{ services.restic.version }}"
restart: unless-stopped
environment:
RUN_ON_STARTUP: 'false'
CHECK_CRON: '0 30 4 * * *'
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}"
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_CHECK_ARGS: >-
--verbose
B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}"
B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}"
TZ: "{{ timezone }}"