Try alternative when creating directories.
This commit is contained in:
15
hetzner.yaml
15
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 }}"
|
||||
|
||||
Reference in New Issue
Block a user