From 00799257383213bf66625e0392d94de6289f1b71 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 14 Apr 2020 11:23:30 +0200 Subject: [PATCH] Use defined syntax and make sure to create directories --- plays/lib/volumes.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plays/lib/volumes.yml b/plays/lib/volumes.yml index ee00483..1a71dd7 100644 --- a/plays/lib/volumes.yml +++ b/plays/lib/volumes.yml @@ -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 dokku_storage: app: "{{ app }}" mounts: "{{ item }}" - with_items: "{{ lookup('vars', 'mounts', default=[]) }}" + with_items: "{{ mounts }}" + when: mounts is defined