Use docker_service ansible command

This commit is contained in:
Jesper Hess 2021-01-26 20:40:22 +01:00
parent 6d2fbdbbb6
commit 9ae295896f
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F

View file

@ -1,18 +1,14 @@
--- ---
- docker_service:
- name: restic network project_name: restic_backup
docker_network: pull: yes
name: restic definition:
version: '3.6'
- name: restic container services:
docker_container: restic-backup:
name: restic-backup
image: mazzolino/restic image: mazzolino/restic
state: started restart: always
restart_policy: always environment:
networks:
- name: restic
env:
RUN_ON_STARTUP: "true" RUN_ON_STARTUP: "true"
BACKUP_CRON: "0 30 3 * * *" BACKUP_CRON: "0 30 3 * * *"
RESTIC_REPOSITORY: "rest:https://datacoop:{{ restic_secrets.user_secret }}@restic.graffen.io/datacoop-hevonen" RESTIC_REPOSITORY: "rest:https://datacoop:{{ restic_secrets.user_secret }}@restic.graffen.io/datacoop-hevonen"
@ -30,3 +26,12 @@
TZ: Europe/Copenhagen TZ: Europe/Copenhagen
volumes: volumes:
- /docker-volumes:/mnt/volumes:ro - /docker-volumes:/mnt/volumes:ro
restic-prune:
image: "mazzolino/restic"
environment:
RUN_ON_STARTUP: "true"
PRUNE_CRON: "0 0 4 * * *"
RESTIC_REPOSITORY: "rest:https://datacoop:{{ restic_secrets.user_secret }}@restic.graffen.io/datacoop-hevonen"
RESTIC_PASSWORD: "{{ restic_secrets.encryption_secret }}"
TZ: Europe/copenhagen