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/post-deploy.yml

48 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: Set HTTP 80 port proxy
dokku_ports:
app: keycloak
mappings:
2020-03-29 09:51:17 +00:00
- "http:80:{{ http_port }}"
2020-03-22 14:40:59 +00:00
state: present
- name: Setup LE certificates
shell: dokku letsencrypt keycloak
args:
creates: /home/dokku/keycloak/letsencrypt/certs
- name: Setup LE certificates renew cron job
shell: dokku letsencrypt:cron-job --add
args:
creates: /home/dokku/keycloak/letsencrypt/cron-job
- name: Specify certificate docker volume mounts
dokku_storage:
app: keycloak
mounts:
2020-03-29 09:51:17 +00:00
- /home/dokku/keycloak/letsencrypt/certs/current/key.pem:/etc/x509/https/tls.key
- /home/dokku/keycloak/letsencrypt/certs/current/cert.pem:/etc/x509/https/tls.crt
2020-03-22 14:40:59 +00:00
- name: Remove automatically configured ports
dokku_ports:
app: keycloak
mappings:
2020-03-29 09:51:17 +00:00
- "http:{{ http_port }}:{{ http_port }}"
2020-03-22 14:40:59 +00:00
state: absent
- name: Set HTTP 443 port
dokku_ports:
app: keycloak
mappings:
2020-03-29 11:38:08 +00:00
- "https:443:{{ http_port }}"
2020-03-22 14:40:59 +00:00
state: present