---
- name: Set database facts
no_log: true
set_fact:
mount_map:
mariadb: /var/lib/mysql
when: config.db
- name: "Create {{ item.type }} database"
shell: "
dokku
{{ item.type }}:create
{{ dokku.app }}
--password {{ item.passwd }}
--root-password {{ item.root_passwd }}
"
args:
creates: "/var/lib/dokku/services/{{ item.type }}/{{ dokku.app }}"
with_items: "{{ config.db }}"
- name: "Link {{ item.type }} database to application"
dokku_service_link:
app: "{{ dokku.app }}"
name: "{{ dokku.app }}"
service: "{{ item.type }}"
- name: "Specify {{ item.type }} volume mounts"
dokku_storage:
mounts:
- "/var/lib/dokku/services/{{ item.type }}/{{ dokku.app }}:{{ mount_map[item.type] }}"