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

43 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
2020-03-22 15:17:46 +00:00
- name: Create postgres database
shell: "dokku postgres:create keycloak --password {{ db_passwd }} --root-password {{ root_db_passwd }}"
2020-03-22 14:40:59 +00:00
args:
2020-03-22 15:17:46 +00:00
creates: /var/lib/dokku/services/postgres/keycloak
2020-03-22 14:40:59 +00:00
2020-03-22 15:17:46 +00:00
- name: Specify postgres docker volume mounts
2020-03-22 14:40:59 +00:00
dokku_storage:
app: keycloak
mounts:
2020-03-22 15:17:46 +00:00
- /var/lib/dokku/services/postgres/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 15:17:46 +00:00
DB_ADDR: "dokku-postgres-keycloak"
2020-03-22 15:01:01 +00:00
DB_DATABASE: "keycloak"
DB_PASSWORD: "{{ db_passwd }}"
2020-03-22 15:17:46 +00:00
DB_USER: "postgres" # https://github.com/dokku/dokku-mariadb/issues/89
DB_VENDOR: "postgres"
2020-03-22 14:40:59 +00:00
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}"
KEYCLOAK_USER: "{{ autonomic_admin_user }}"
2020-03-22 15:01:01 +00:00
PROXY_ADDRESS_FORWARDING: "true"