add better conditionals

This commit is contained in:
Andreas Zweili 2021-11-15 18:27:44 +01:00
parent f702241b55
commit 5302081a43
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@
mode: "751"
when: restic_extract is changed
- name: "Copy the backup script"
- name: "Copy the docker backup script"
blockinfile:
path: "/home/ansible/backup-to-restic"
mode: 0755
@ -38,7 +38,7 @@
sudo docker-compose pause
sudo -E restic backup /home/ansible --exclude-file=/etc/restic/excludes.txt
sudo docker-compose unpause
when: "'docker' in group_names"
when: "'docker' in group_names and docker_skip_project is undefined"
- name: "Copy the backup script"
blockinfile:
@ -52,7 +52,7 @@
export RESTIC_PASSWORD={{ restic_password }}
restic backup /home/andreas --exclude-file=/etc/restic/excludes.txt
when: "'docker' not in group_names"
when: docker_skip_project
- name: "Create the restic config dir"
file: