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
1 changed files with 36 additions and 31 deletions

View File

@ -1,18 +1,14 @@
---
- name: restic network
docker_network:
name: restic
- name: restic container
docker_container:
name: restic-backup
- docker_service:
project_name: restic_backup
pull: yes
definition:
version: '3.6'
services:
restic-backup:
image: mazzolino/restic
state: started
restart_policy: always
networks:
- name: restic
env:
restart: always
environment:
RUN_ON_STARTUP: "true"
BACKUP_CRON: "0 30 3 * * *"
RESTIC_REPOSITORY: "rest:https://datacoop:{{ restic_secrets.user_secret }}@restic.graffen.io/datacoop-hevonen"
@ -30,3 +26,12 @@
TZ: Europe/Copenhagen
volumes:
- /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