From 7c3802fa2c79a3564235cd199a9d90120a278817 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 14 Apr 2020 11:16:06 +0200 Subject: [PATCH] Only run if {{ db }} is defined --- plays/lib/database.yml | 4 ++++ plays/post_delete.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plays/lib/database.yml b/plays/lib/database.yml index bfe4303..fdb285f 100644 --- a/plays/lib/database.yml +++ b/plays/lib/database.yml @@ -3,6 +3,7 @@ set_fact: mount_map: mariadb: /var/lib/mysql + when: db is defined - name: "Create {{ item.type }} database" no_log: true @@ -16,6 +17,7 @@ args: creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}" with_items: "{{ db }}" + when: db is defined - name: "Link {{ item.type }} database to application" dokku_service_link: @@ -23,6 +25,7 @@ name: "{{ app }}" service: "{{ item.type }}" with_items: "{{ db }}" + when: db is defined - name: "Specify {{ item.type }} volume mounts" dokku_storage: @@ -30,3 +33,4 @@ mounts: - "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}" with_items: "{{ db }}" + when: db is defined diff --git a/plays/post_delete.yml b/plays/post_delete.yml index 59d417d..c2993c0 100644 --- a/plays/post_delete.yml +++ b/plays/post_delete.yml @@ -13,4 +13,4 @@ args: removes: "/var/lib/dokku/services/{{ item.type }}/{{ app }}" with_items: "{{ db }}" - when: db exists + when: db is defined