mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Ensure that keycloak is up
This commit is contained in:
19
roles/web-app-keycloak/tasks/01_import.yml
Normal file
19
roles/web-app-keycloak/tasks/01_import.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: "load variables from {{ DOCKER_VARS_FILE }}"
|
||||
include_vars: "{{ DOCKER_VARS_FILE }}"
|
||||
|
||||
- name: Set the directory to which keycloack import files will be copied on host
|
||||
set_fact:
|
||||
keycloak_host_import_directory: "{{ docker_compose.directories.volumes }}import/"
|
||||
|
||||
- name: "create directory {{keycloak_host_import_directory}}"
|
||||
file:
|
||||
path: "{{keycloak_host_import_directory}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: "Copy import files to {{ keycloak_host_import_directory }}"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ keycloak_host_import_directory }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
|
||||
mode: '770'
|
||||
loop: "{{ lookup('fileglob', '{{ role_path }}/templates/import/*.j2', wantlist=True) }}"
|
@@ -1,22 +1,11 @@
|
||||
---
|
||||
- name: "create import files for {{application_id}}"
|
||||
include_tasks: 01_import.yml
|
||||
|
||||
- name: "load docker, db and proxy for {{application_id}}"
|
||||
include_role:
|
||||
name: cmp-db-docker-proxy
|
||||
|
||||
- name: "create directory {{keycloak_host_import_directory}}"
|
||||
file:
|
||||
path: "{{keycloak_host_import_directory}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: "Copy import files to {{ keycloak_host_import_directory }}"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ keycloak_host_import_directory }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
|
||||
mode: '770'
|
||||
loop: "{{ lookup('fileglob', '{{ role_path }}/templates/import/*.j2', wantlist=True) }}"
|
||||
notify: docker compose up
|
||||
|
||||
# Deactivated temporary. Import now via realm.yml
|
||||
#- name: Implement SSH Public Key Attribut
|
||||
# include_tasks: attributes/ssh_public_key.yml
|
||||
# include_tasks: attributes/ssh_public_key.yml
|
||||
|
@@ -4,7 +4,6 @@ database_type: "postgres"
|
||||
|
||||
# Keycloak Specific
|
||||
keycloak_container: "{{ applications | get_app_conf(application_id, 'docker.services.keycloak.name', True) }}" # Name of the keycloack docker container
|
||||
keycloak_host_import_directory: "{{ docker_compose.directories.volumes }}import/" # Directory in which keycloack import files are placed on the host
|
||||
keycloak_docker_import_directory: "/opt/keycloak/data/import/" # Directory in which keycloack import files are placed in the running docker container
|
||||
keycloak_realm: "{{ primary_domain}}" # This is the name of the default realm which is used by the applications
|
||||
keycloak_administrator: "{{ applications | get_app_conf(application_id, 'users.administrator', True) }}" # Master Administrator
|
||||
@@ -20,4 +19,4 @@ keycloak_import_realm: "{{ applications | get_app_conf(application_id
|
||||
keycloak_debug_enabled: "{{ enable_debug }}"
|
||||
|
||||
# Docker
|
||||
docker_compose_flush_handlers: false # Copy realm import etc. before flush
|
||||
docker_compose_flush_handlers: true # Remember to copy realm import before flushg when set to true
|
Reference in New Issue
Block a user