Only run if {{ db }} is defined
This commit is contained in:
parent
584360421b
commit
7c3802fa2c
@ -3,6 +3,7 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
mount_map:
|
mount_map:
|
||||||
mariadb: /var/lib/mysql
|
mariadb: /var/lib/mysql
|
||||||
|
when: db is defined
|
||||||
|
|
||||||
- name: "Create {{ item.type }} database"
|
- name: "Create {{ item.type }} database"
|
||||||
no_log: true
|
no_log: true
|
||||||
@ -16,6 +17,7 @@
|
|||||||
args:
|
args:
|
||||||
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
||||||
with_items: "{{ db }}"
|
with_items: "{{ db }}"
|
||||||
|
when: db is defined
|
||||||
|
|
||||||
- name: "Link {{ item.type }} database to application"
|
- name: "Link {{ item.type }} database to application"
|
||||||
dokku_service_link:
|
dokku_service_link:
|
||||||
@ -23,6 +25,7 @@
|
|||||||
name: "{{ app }}"
|
name: "{{ app }}"
|
||||||
service: "{{ item.type }}"
|
service: "{{ item.type }}"
|
||||||
with_items: "{{ db }}"
|
with_items: "{{ db }}"
|
||||||
|
when: db is defined
|
||||||
|
|
||||||
- name: "Specify {{ item.type }} volume mounts"
|
- name: "Specify {{ item.type }} volume mounts"
|
||||||
dokku_storage:
|
dokku_storage:
|
||||||
@ -30,3 +33,4 @@
|
|||||||
mounts:
|
mounts:
|
||||||
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"
|
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"
|
||||||
with_items: "{{ db }}"
|
with_items: "{{ db }}"
|
||||||
|
when: db is defined
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
args:
|
args:
|
||||||
removes: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
removes: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
||||||
with_items: "{{ db }}"
|
with_items: "{{ db }}"
|
||||||
when: db exists
|
when: db is defined
|
||||||
|
Reference in New Issue
Block a user