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

54 lines
1.4 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
2020-03-29 09:51:17 +00:00
shell: "
dokku
mariadb:create
keycloak
--password {{ db_passwd }}
--root-password {{ root_db_passwd }}
"
2020-03-22 14:40:59 +00:00
args:
creates: /var/lib/dokku/services/mariadb/keycloak
2020-03-22 14:40:59 +00:00
2020-03-22 16:58:49 +00:00
- name: Link mariadb database to application
dokku_service_link:
app: keycloak
name: keycloak
service: mariadb
- name: Specify mariadb docker volume mounts
2020-03-22 14:40:59 +00:00
dokku_storage:
app: keycloak
mounts:
- /var/lib/dokku/services/mariadb/keycloak:/var/lib/mysql
2020-03-22 14:40:59 +00:00
- name: Configure the dokku app environment
dokku_config:
app: keycloak
restart: false
config:
2020-03-22 16:58:49 +00:00
DB_ADDR: "dokku-mariadb-keycloak:3306"
2020-03-22 15:01:01 +00:00
DB_DATABASE: "keycloak"
DB_PASSWORD: "{{ db_passwd }}"
DB_USER: "mariadb" # https://github.com/dokku/dokku-mariadb/issues/89
DB_VENDOR: "mariadb"
2020-03-22 14:40:59 +00:00
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}"
KEYCLOAK_USER: "{{ autonomic_admin_user }}"