Group plays to hooks

This commit is contained in:
Luke Murphy
2020-04-14 11:30:40 +02:00
parent 0079925738
commit c099827d88
16 changed files with 63 additions and 63 deletions

View File

@ -0,0 +1,36 @@
---
- name: Set database facts
set_fact:
mount_map:
mariadb: /var/lib/mysql
when: db is defined
- 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 }}"
when: db is defined
- name: "Link {{ item.type }} database to application"
dokku_service_link:
app: "{{ app }}"
name: "{{ app }}"
service: "{{ item.type }}"
with_items: "{{ db }}"
when: db is defined
- 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 }}"
when: db is defined