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 c23076abe5b2ac122bd65c394390b807d7eda41a..b6224dd3c115580aaff1c285aa02b6aae88a2240 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