---
- hosts: all
gather_facts: false
tasks:
- name: Load variables
include_vars:
dir: "{{ dokku_lib_root }}/data/ansible/keycloak/vars/"
extensions:
- yml
- name: Configure id.autonomic.zone domain
dokku_domains:
app: keycloak
domains:
- id.autonomic.zone
state: present
- name: Create postgres database
shell: "dokku postgres:create keycloak --password {{ db_passwd }} --root-password {{ root_db_passwd }}"
args:
creates: /var/lib/dokku/services/postgres/keycloak
- name: Specify postgres docker volume mounts
dokku_storage:
mounts:
- /var/lib/dokku/services/postgres/keycloak:/var/lib/mysql
- name: Configure the dokku app environment
dokku_config:
restart: false
config:
DB_ADDR: "dokku-postgres-keycloak"
DB_DATABASE: "keycloak"
DB_PASSWORD: "{{ db_passwd }}"
DB_USER: "postgres" # https://github.com/dokku/dokku-mariadb/issues/89
DB_VENDOR: "postgres"
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}"
KEYCLOAK_USER: "{{ autonomic_admin_user }}"
PROXY_ADDRESS_FORWARDING: "true"