Optimized keycloak variables

This commit is contained in:
2025-07-14 11:20:10 +02:00
parent 076a2058cc
commit bfd1a2ee70
5 changed files with 29 additions and 25 deletions

View File

@@ -72,11 +72,11 @@
- name: Render user-profile JSON for SSH key
template:
src: import/user-profile.json.j2
dest: "{{ import_directory_host }}/user-profile.json"
dest: "{{ keycloak_host_import_directory }}/user-profile.json"
mode: '0644'
notify: docker compose up
- name: Apply SSH Public Key to user-profile via kcadm
shell: |
docker exec -i {{ container_name }} \
/opt/keycloak/bin/kcadm.sh update realms/{{ keycloak_realm }} -f {{ import_directory_docker }}user-profile.json
/opt/keycloak/bin/kcadm.sh update realms/{{ keycloak_realm }} -f {{ keycloak_docker_import_directory }}user-profile.json

View File

@@ -3,16 +3,16 @@
include_role:
name: cmp-db-docker-proxy
- name: "create directory {{import_directory_host}}"
- name: "create directory {{keycloak_host_import_directory}}"
file:
path: "{{import_directory_host}}"
path: "{{keycloak_host_import_directory}}"
state: directory
mode: 0755
- name: "Copy import files to {{ import_directory_host }}"
- name: "Copy import files to {{ keycloak_host_import_directory }}"
template:
src: "{{ item }}"
dest: "{{ import_directory_host }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
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