Adapt to more scoped config

This commit is contained in:
Luke Murphy
2020-04-14 13:02:16 +02:00
parent ddaa516e38
commit 22e15e4b50
11 changed files with 55 additions and 27 deletions

View File

@ -10,27 +10,27 @@
shell: "
dokku
{{ item.type }}:create
{{ app }}
{{ dokku.app }}
--password {{ item.passwd }}
--root-password {{ item.root_passwd }}
"
args:
creates: "/var/lib/dokku/services/{{ item.type }}/{{ app }}"
creates: "/var/lib/dokku/services/{{ item.type }}/{{ dokku.app }}"
with_items: "{{ db }}"
when: db is defined
- name: "Link {{ item.type }} database to application"
dokku_service_link:
app: "{{ app }}"
name: "{{ app }}"
app: "{{ dokku.app }}"
name: "{{ dokku.app }}"
service: "{{ item.type }}"
with_items: "{{ db }}"
when: db is defined
- name: "Specify {{ item.type }} volume mounts"
dokku_storage:
app: "{{ app }}"
app: "{{ dokku.app }}"
mounts:
- "/var/lib/dokku/services/{{ item.type }}/{{ app }}:{{ mount_map[item.type] }}"
- "/var/lib/dokku/services/{{ item.type }}/{{ dokku.app }}:{{ mount_map[item.type] }}"
with_items: "{{ db }}"
when: db is defined

View File

@ -1,8 +1,8 @@
---
- name: "Configure {{ domain }} dedicated domain"
- name: "Configure {{ vars.domain }} dedicated domain"
dokku_domains:
app: "{{ app }}"
app: "{{ dokku.app }}"
domains:
- "{{ domain }}"
- "{{ vars.domain }}"
state: present
when: domain is defined
when: vars.domain is defined

View File

@ -1,7 +1,7 @@
---
- name: Configure the app environment
dokku_config:
app: "{{ app }}"
app: "{{ dokku.app }}"
restart: false
config: "{{ env }}"
when: env is defined

View File

@ -0,0 +1,9 @@
---
- name: Copy over template files
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: dokku
group: dokku
with_items: "{{ templates }}"
when: templates is defined