diff --git a/defaults/main.yml b/defaults/main.yml index 702f71a49a56e9f1ec3548770f71bc5bc7a6bdce..116687fb68a1181e477b412bc67dfa972691952b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,6 +16,7 @@ backups: restic: url: /var/backup-client/restic repo_type: local + repo_folder_create: true additional_keys: {} mode: vm-via-hypervisor enabled: True diff --git a/tasks/main.yml b/tasks/main.yml index bbab3d3f5dfe04d1d5ad629c2d9c9c14500f9e00..855e4ad7d684b3928013177fd17f5dd04d9b865c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -196,7 +196,9 @@ export RESTIC_REPOSITORY="{{ backups.backends.restic.url }}" export RESTIC_PASSWORD_FILE="/etc/backup-client/restic.key" - name: create restic repository folder - when: backups.backends.restic.repo_type == 'local' + when: + - backups.backends.restic.repo_type == 'local' + - backups.backends.restic.repo_folder_create file: path: "{{ backups.backends.restic.url }}" state: directory