This repository has been archived on 2020-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-deploy/plays/predeploy/lib/database.yml
2020-04-14 13:44:09 +02:00

40 lines
948 B
YAML

---
- name: Set database facts
no_log: true
set_fact:
mount_map:
mariadb: /var/lib/mysql
when: config.db
- name: "Create {{ item.type }} database"
no_log: true
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 }}"
when: config.db
- name: "Link {{ item.type }} database to application"
no_log: true
dokku_service_link:
app: "{{ dokku.app }}"
name: "{{ dokku.app }}"
service: "{{ item.type }}"
with_items: "{{ config.db }}"
when: config.db
- name: "Specify {{ item.type }} volume mounts"
no_log: true
dokku_storage:
app: "{{ dokku.app }}"
mounts:
- "/var/lib/dokku/services/{{ item.type }}/{{ dokku.app }}:{{ mount_map[item.type] }}"
with_items: "{{ config.db }}"
when: config.db