Drop debug, names and use with_items for db tasks
This commit is contained in:
parent
878b1df3b4
commit
584360421b
@ -1,31 +1,32 @@
|
||||
---
|
||||
- name: Run database setup tasks
|
||||
block:
|
||||
- name: Set database facts
|
||||
- name: Set database facts
|
||||
set_fact:
|
||||
mount_map:
|
||||
mariadb: /var/lib/mysql
|
||||
|
||||
- name: "Create {{ store.type }} database"
|
||||
- name: "Create {{ item.type }} database"
|
||||
no_log: true
|
||||
shell: "
|
||||
dokku
|
||||
{{ store.type }}:create
|
||||
{{ item.type }}:create
|
||||
{{ app }}
|
||||
--password {{ store.passwd }}
|
||||
--root-password {{ store.root_passwd }}
|
||||
--password {{ item.passwd }}
|
||||
--root-password {{ item.root_passwd }}
|
||||
"
|
||||
args:
|
||||
creates: "/var/lib/dokku/services/{{ store.type }}/{{ app }}"
|
||||
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
|
||||
with_items: "{{ db }}"
|
||||
|
||||
- name: "Link {{ store.type }} database to application"
|
||||
- name: "Link {{ item.type }} database to application"
|
||||
dokku_service_link:
|
||||
app: "{{ app }}"
|
||||
name: "{{ app }}"
|
||||
service: "{{ store.type }}"
|
||||
service: "{{ item.type }}"
|
||||
with_items: "{{ db }}"
|
||||
|
||||
- name: "Specify {{ store.type }} volume mounts"
|
||||
- name: "Specify {{ item.type }} volume mounts"
|
||||
dokku_storage:
|
||||
app: "{{ app }}"
|
||||
mounts:
|
||||
- "/var/lib/dokku/services/{{ store.type }}/{{ app }}:{{ mount_map[store.type] }}"
|
||||
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"
|
||||
with_items: "{{ db }}"
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
- name: Debug all variables
|
||||
debug:
|
||||
msg: "{{ vars }}"
|
||||
when: debug
|
@ -2,23 +2,12 @@
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Include prepare tasks
|
||||
include: ./lib/prepare.yml
|
||||
|
||||
- name: Include vars tasks
|
||||
include: ./lib/vars.yml
|
||||
|
||||
# Note(decentral1se): internal debugging. Please `debug: true` in the
|
||||
# /var/lib/dokku/data/deploy.d/vars.yml file to activate a debug vars dump
|
||||
- name: Include debug tasks
|
||||
include: ./lib/debug.yml
|
||||
when: debug is defined
|
||||
|
||||
- include: ./lib/prepare.yml
|
||||
- include: ./lib/vars.yml
|
||||
- name: Remove deploy.d folder
|
||||
file:
|
||||
path: "{{ app_config_root }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove database(s)
|
||||
shell: "dokku {{ item.type }}:destroy {{ app }} --force"
|
||||
args:
|
||||
|
@ -2,23 +2,8 @@
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Include prepare tasks
|
||||
include: ./lib/prepare.yml
|
||||
|
||||
- name: Include vars tasks
|
||||
include: ./lib/vars.yml
|
||||
|
||||
# Note(decentral1se): internal debugging. Please `debug: true` in the
|
||||
# /var/lib/dokku/data/deploy.d/vars.yml file to activate a debug vars dump
|
||||
- name: Include debug tasks
|
||||
include: ./lib/debug.yml
|
||||
when: debug is defined
|
||||
|
||||
- name: Include http tasks
|
||||
include: ./lib/http.yml
|
||||
|
||||
- name: Include https tasks
|
||||
include: ./lib/https.yml
|
||||
|
||||
- name: Include proxy tasks
|
||||
include: ./lib/proxy.yml
|
||||
- include: ./lib/prepare.yml
|
||||
- include: ./lib/vars.yml
|
||||
- include: ./lib/http.yml
|
||||
- include: ./lib/https.yml
|
||||
- include: ./lib/proxy.yml
|
||||
|
@ -2,28 +2,9 @@
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Include prepare tasks
|
||||
include: ./lib/prepare.yml
|
||||
|
||||
- name: Include vars tasks
|
||||
include: ./lib/vars.yml
|
||||
|
||||
# Note(decentral1se): internal debugging. Please `debug: true` in the
|
||||
# /var/lib/dokku/data/deploy.d/vars.yml file to activate a debug vars dump
|
||||
- name: Include debug tasks
|
||||
include: ./lib/debug.yml
|
||||
when: debug is defined
|
||||
|
||||
- name: Include domain tasks
|
||||
include: ./lib/domain.yml
|
||||
|
||||
- name: Include database tasks
|
||||
include: ./lib/database.yml store={{ item }}
|
||||
with_items: "{{ db }}"
|
||||
when: db is defined
|
||||
|
||||
- name: Include volume tasks
|
||||
include: ./lib/volumes.yml
|
||||
|
||||
- name: Include env tasks
|
||||
include: ./lib/env.yml
|
||||
- include: ./lib/prepare.yml
|
||||
- include: ./lib/vars.yml
|
||||
- include: ./lib/domain.yml
|
||||
- include: ./lib/database.yml
|
||||
- include: ./lib/volumes.yml
|
||||
- include: ./lib/env.yml
|
||||
|
Reference in New Issue
Block a user