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/lib/database.yml

33 lines
774 B
YAML
Raw Normal View History

2020-04-13 09:42:33 +00:00
---
- name: Set database facts
set_fact:
mount_map:
mariadb: /var/lib/mysql
- name: "Create {{ item.type }} database"
no_log: true
shell: "
dokku
{{ item.type }}:create
{{ app }}
--password {{ item.passwd }}
--root-password {{ item.root_passwd }}
"
args:
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
with_items: "{{ db }}"
2020-04-13 09:42:33 +00:00
- name: "Link {{ item.type }} database to application"
dokku_service_link:
app: "{{ app }}"
name: "{{ app }}"
service: "{{ item.type }}"
with_items: "{{ db }}"
2020-04-13 13:02:55 +00:00
- name: "Specify {{ item.type }} volume mounts"
dokku_storage:
app: "{{ app }}"
mounts:
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"
with_items: "{{ db }}"