Only run if {{ db }} is defined
This commit is contained in:
parent
584360421b
commit
7c3802fa2c
@ -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
|
||||
|
@ -13,4 +13,4 @@
|
||||
args:
|
||||
removes: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
||||
with_items: "{{ db }}"
|
||||
when: db exists
|
||||
when: db is defined
|
||||
|
Reference in New Issue
Block a user