Try alternative when creating directories.
This commit is contained in:
15
hetzner.yaml
15
hetzner.yaml
@@ -13,19 +13,10 @@
|
|||||||
path: "{{ backup_dir }}"
|
path: "{{ backup_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Check if directories exist
|
- name: Check if customer directories exist
|
||||||
stat:
|
file:
|
||||||
path: "{{ backup_dir }}/{{ item.key }}"
|
path: "{{ backup_dir }}/{{ item.key }}"
|
||||||
register: dirs
|
state: directory
|
||||||
loop: "{{ lookup('dict', customers) }}"
|
loop: "{{ lookup('dict', customers) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
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