31 lines
708 B
YAML
31 lines
708 B
YAML
---
|
|
- name: Setup preparatory facts
|
|
set_fact:
|
|
db_type: "{{ db['type'] }}"
|
|
mount_map:
|
|
mariadb: /var/lib/mysql
|
|
|
|
- name: "Create {{ db_type }} database"
|
|
no_log: true
|
|
shell: "
|
|
dokku
|
|
{{ db_type }}:create
|
|
{{ app }}
|
|
--password {{ db_passwd }}
|
|
--root-password {{ root_db_passwd }}
|
|
"
|
|
args:
|
|
creates: "/var/lib/dokku/services/{{ db_type }}/{{ app }}"
|
|
|
|
- name: Link mariadb database to application
|
|
dokku_service_link:
|
|
app: "{{ app }}"
|
|
name: "{{ app }}"
|
|
service: "{{ db_type }}"
|
|
|
|
- name: "Specify {{ db_type }} volume mounts"
|
|
dokku_storage:
|
|
app: "{{ app }}"
|
|
mounts:
|
|
- "/var/lib/dokku/services/{{ db_type }}/{{ app }}:{{ mount_map[db_type] }}"
|