Use defined syntax and make sure to create directories

This commit is contained in:
Luke Murphy 2020-04-14 11:23:30 +02:00
parent 7c3802fa2c
commit 0079925738
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -1,6 +1,17 @@
--- ---
- name: Create volume mount directories
become: true
file:
path: "{{ item }}"
state: directory
owner: dokku
group: dokku
with_items: "{{ mounts }}"
when: mounts is defined
- name: Attach volume mounts - name: Attach volume mounts
dokku_storage: dokku_storage:
app: "{{ app }}" app: "{{ app }}"
mounts: "{{ item }}" mounts: "{{ item }}"
with_items: "{{ lookup('vars', 'mounts', default=[]) }}" with_items: "{{ mounts }}"
when: mounts is defined