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

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