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

32 lines
709 B
YAML
Raw Normal View History

2020-04-13 09:42:33 +00:00
---
2020-04-13 10:49:14 +00:00
- name: Setup preparatory facts
set_fact:
db_type: "{{ db['type'] }}"
mount_map:
mariadb: /var/lib/mysql
- name: "Create {{ db_type }} database"
2020-04-13 09:42:33 +00:00
no_log: true
shell: "
dokku
2020-04-13 10:49:14 +00:00
{{ db_type }}:create
2020-04-13 09:42:33 +00:00
{{ app }}
--password {{ db_passwd }}
--root-password {{ root_db_passwd }}
"
args:
2020-04-13 10:49:14 +00:00
creates: "/var/lib/dokku/services/{{ db_type }}/{{ app }}"
2020-04-13 09:42:33 +00:00
- name: Link mariadb database to application
dokku_service_link:
2020-04-13 10:49:14 +00:00
app: "{{ app }}"
name: "{{ app }}"
service: "{{ db_type }}"
2020-04-13 09:42:33 +00:00
2020-04-13 10:49:14 +00:00
- name: "Specify {{ db_type }} volume mounts"
2020-04-13 09:42:33 +00:00
dokku_storage:
2020-04-13 10:49:14 +00:00
app: "{{ app }}"
2020-04-13 09:42:33 +00:00
mounts:
2020-04-13 10:49:14 +00:00
- "/var/lib/dokku/services/{{ db_type }}/{{ app }}:{{ mount_map[db_type] }}"