Actually, we don't need python at all

This commit is contained in:
Luke Murphy
2020-04-13 11:42:33 +02:00
parent b3e2d08100
commit ded81dab45
12 changed files with 137 additions and 79 deletions

7
plays/lib/config.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: Load app config into playbook context
include_vars:
dir: "{{ app_config_root }}"
extensions:
- yml
- yaml

25
plays/lib/database.yml Normal file
View File

@ -0,0 +1,25 @@
---
- name: "Create {{ db['type'] }} database"
no_log: true
shell: "
dokku
{{ db['type'] }}:create
{{ app }}
--password {{ db_passwd }}
--root-password {{ root_db_passwd }}
"
args:
creates: "/var/lib/dokku/services/{{ db['type'] }}/{{ app }}"
- name: Link mariadb database to application
dokku_service_link:
app: keycloak
name: keycloak
service: mariadb
- name: Specify mariadb docker volume mounts
dokku_storage:
app: keycloak
mounts:
- /var/lib/dokku/services/mariadb/keycloak:/var/lib/mysql

7
plays/lib/domain.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: "Configure {{ domain }} domain with Dokku"
dokku_domains:
app: "{{ app }}"
domains:
- "{{ domain }}"
state: present

13
plays/lib/vault.yml Normal file
View File

@ -0,0 +1,13 @@
---
- name: Check if vault variables are available for loading
stat:
path: "{{ app_config_root }}/vault/"
register: vault_dir
- name: Load vault variables into playbook context
include_vars:
dir: "{{ app_config_root }}/vault/"
extensions:
- yml
- yaml
when: vault_dir.stat.exists