From f6b0086c6c7d05e4bc1d55eefff84c94ae99bc82 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 21 Nov 2021 22:12:45 +0100 Subject: [PATCH] Try alternative when creating directories. --- hetzner.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/hetzner.yaml b/hetzner.yaml index b4cb928..03a59bb 100644 --- a/hetzner.yaml +++ b/hetzner.yaml @@ -13,19 +13,10 @@ path: "{{ backup_dir }}" state: directory - - name: Check if directories exist - stat: + - name: Check if customer directories exist + file: path: "{{ backup_dir }}/{{ item.key }}" - register: dirs + state: directory loop: "{{ lookup('dict', customers) }}" loop_control: label: "{{ item.key }}" - - - debug: var=dirs - - - name: Create not existing directories - debug: var=item.invocation.module_args.path - when: item.stat.exists == false - with_items: "{{ dirs.results }}" - loop_control: - label: "{{ item.item }}"