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
827 B
YAML
Raw Normal View History

2020-04-13 09:42:33 +00:00
---
- name: Setup database facts
set_fact:
mount_map:
mariadb: /var/lib/mysql
2020-04-13 10:49:14 +00:00
2020-04-13 13:02:55 +00:00
- name: Run database setup tasks
block:
2020-04-13 13:57:35 +00:00
- name: "Create {{ item.type }} database"
2020-04-13 13:02:55 +00:00
no_log: true
shell: "
dokku
2020-04-13 13:57:35 +00:00
{{ item.type }}:create
2020-04-13 13:02:55 +00:00
{{ app }}
2020-04-13 13:57:35 +00:00
--password {{ item.passwd }}
--root-password {{ item.root_passwd }}
2020-04-13 13:02:55 +00:00
"
args:
2020-04-13 13:57:35 +00:00
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
2020-04-13 09:42:33 +00:00
2020-04-13 14:17:11 +00:00
- name: "Link {{ item.type }} database to application"
2020-04-13 13:02:55 +00:00
dokku_service_link:
app: "{{ app }}"
name: "{{ app }}"
2020-04-13 13:57:35 +00:00
service: "{{ item.type }}"
2020-04-13 13:02:55 +00:00
2020-04-13 13:57:35 +00:00
- name: "Specify {{ item.type }} volume mounts"
2020-04-13 13:02:55 +00:00
dokku_storage:
app: "{{ app }}"
mounts:
2020-04-13 13:57:35 +00:00
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"