TEST
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
- name: Find exact top-level Keycloak group
|
||||
ansible.builtin.uri:
|
||||
url: "{{ kc_api }}/groups?search={{ kc_group_name | urlencode }}&exact=true&first=0&max=100&briefRepresentation=true"
|
||||
headers: "{{ kc_headers }}"
|
||||
register: kc_group_search
|
||||
- name: Create missing top-level Keycloak group
|
||||
ansible.builtin.uri:
|
||||
url: "{{ kc_api }}/groups"
|
||||
headers: "{{ kc_headers }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
name: "{{ kc_group_name }}"
|
||||
status_code: 201
|
||||
when: kc_group_search.json | selectattr('path', 'equalto', '/' ~ kc_group_name) | list | length == 0
|
||||
changed_when: true
|
||||
Reference in New Issue
Block a user