diff --git a/roles/docker_services/defaults/main.yml b/roles/docker_services/defaults/main.yml index 7c1dfb3..2d4b9cc 100644 --- a/roles/docker_services/defaults/main.yml +++ b/roles/docker_services/defaults/main.yml @@ -60,7 +60,8 @@ services: sender_domains: - "{{ services.nextcloud.domain }}" -backup_volumes: +restic_volumes: + - "/var/run/docker.sock:/var/run/docker.sock:rw" - "{{ services.caddy.volume }}:/mnt/volumes/caddy:ro" - "{{ services.postfix.volume }}:/mnt/volumes/postfix:ro" - "{{ services.emby.volume }}:/mnt/volumes/emby:ro" diff --git a/roles/docker_services/tasks/services/restic.yml b/roles/docker_services/tasks/services/restic.yml index 2b33a1e..bb9b1ec 100644 --- a/roles/docker_services/tasks/services/restic.yml +++ b/roles/docker_services/tasks/services/restic.yml @@ -29,10 +29,14 @@ --keep-daily 7 --keep-weekly 5 --keep-monthly 12 + PRE_COMMANDS: |- + docker exec -u www-data nextcloud_app_1 php occ maintenance:mode --on + POST_COMMANDS_EXIT: |- + docker exec -u www-data nextcloud_app_1 php occ maintenance:mode --off B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}" B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}" TZ: "{{ timezone }}" - volumes: "{{ backup_volumes }}" + volumes: "{{ restic_volumes }}" prune: image: mazzolino/restic:{{ services.restic.version }}