|
|
|
@ -23,16 +23,34 @@
|
|
|
|
method: GET
|
|
|
|
method: GET
|
|
|
|
headers:
|
|
|
|
headers:
|
|
|
|
Authorization: "Bearer {{ keycloak_authentication.json.access_token }}"
|
|
|
|
Authorization: "Bearer {{ keycloak_authentication.json.access_token }}"
|
|
|
|
status_code: [200]
|
|
|
|
status_code: [200, 404]
|
|
|
|
register: realm_clients
|
|
|
|
register: realm_clients
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
become: false
|
|
|
|
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:
|
|
|
|
set_fact:
|
|
|
|
realm_clients_json: "{{ realm_clients.json }}"
|
|
|
|
realm_clients_json: "{{ realm_clients.json }}"
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
become: false
|
|
|
|
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 }}>"
|
|
|
|
- name: "Saving client <{{ client_name }}> from realm <{{ realm_name }}>"
|
|
|
|
set_fact:
|
|
|
|
set_fact:
|
|
|
|
|