---
- 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 mariadb database
shell: "
dokku
mariadb:create
keycloak
--password {{ db_passwd }}
--root-password {{ root_db_passwd }}
"
args:
creates: /var/lib/dokku/services/mariadb/keycloak
- name: Link mariadb database to application
dokku_service_link:
name: keycloak
service: mariadb
- name: Specify mariadb docker volume mounts
dokku_storage:
mounts:
- /var/lib/dokku/services/mariadb/keycloak:/var/lib/mysql
- name: Configure the dokku app environment
dokku_config:
restart: false
config:
DB_ADDR: "dokku-mariadb-keycloak:3306"
DB_DATABASE: "keycloak"
DB_PASSWORD: "{{ db_passwd }}"
DB_USER: "mariadb" # https://github.com/dokku/dokku-mariadb/issues/89
DB_VENDOR: "mariadb"
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}"
KEYCLOAK_USER: "{{ autonomic_admin_user }}"