This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
id.autonomic.zone/ansible/pre-deploy.yml

42 lines
1.3 KiB
YAML
Raw Normal View History

2020-03-22 14:40:59 +00:00
---
- 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: Specify mariadb docker volume mounts
dokku_storage:
app: keycloak
mounts:
- /var/lib/dokku/services/mariadb/keycloak:/var/lib/mysql
- name: Configure the dokku app environment
dokku_config:
app: keycloak
restart: false
config:
DB_VENDOR: "mariadb"
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}"
KEYCLOAK_USER: "{{ autonomic_admin_user }}"
MYSQL_DATABASE: "keycloak"
MYSQL_PASSWORD: "{{ db_passwd }}"
MYSQL_USER: "mariadb" # https://github.com/dokku/dokku-mariadb/issues/89
MYSQL_ROOT_PASSWORD: "{{ root_db_passwd }}"