You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/keycloak/tasks/configure_client.yml

24 lines
760 B
YAML

---
- name: Print client {{ client_id }} for realm {{ realm_name }}
debug:
msg: "{{ lookup('template','keycloak-realm-create-client.json.j2') }}"
tags:
- always
when:
- debug
- realm_client_ids | selectattr('clientId', 'equalto', client_id) | list | length == 0
- name: Create client {{ client_id }} for realm {{ realm_name }}
uri:
url: "{{ keycloak_server_url }}/auth/admin/realms/{{ realm_name }}/clients"
method: POST
body_format: json
body: "{{ lookup('template','keycloak-realm-create-client.json.j2') }}"
headers:
Authorization: "Bearer {{ access_token }} "
status_code: [201]
when: realm_client_ids | selectattr('clientId', 'equalto', client_id) | list | length == 0
tags:
- update_realms