bugfix: keycloak delete client without existing realm

master
Sven Ketelsen 4 years ago
parent 37cf451edd
commit 79bd58bfc8

@ -23,16 +23,34 @@
method: GET
headers:
Authorization: "Bearer {{ keycloak_authentication.json.access_token }}"
status_code: [200]
status_code: [200, 404]
register: realm_clients
delegate_to: 127.0.0.1
become: false
- name: "Save clients from realm as variable (fact)"
- name: "Read clients from realm {{ realm_name }}"
debug:
msg: "{{ realm_clients }}"
delegate_to: 127.0.0.1
become: false
when:
- debug
- name: "Save clients from realm as variable (fact) - 200"
set_fact:
realm_clients_json: "{{ realm_clients.json }}"
delegate_to: 127.0.0.1
become: false
when:
- realm_clients.status == 200
- name: "Save clients from realm as variable (fact) - 404"
set_fact:
realm_clients_json: []
delegate_to: 127.0.0.1
become: false
when:
- realm_clients.status == 404
- name: "Saving client <{{ client_name }}> from realm <{{ realm_name }}>"
set_fact:

Loading…
Cancel
Save