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