ping:
    auth_keycloak_url: "{{ url }}"
    auth_realm: "{{ admin_realm }}"
    auth_username: "{{ admin_user }}"
    auth_password: "{{ admin_password }}"
    realm: "{{ realm }}"
    client_id: "{{ client_id }}"
    service_account_user_client_id: "{{ client_id }}"
    roles: "{{ roles }}"
    state: absent
  register: result

- name: Assert client role is unassigned
  assert:
    that:
      - result is changed
      - result.end_state == []
      - result.existing | selectattr("clientRole", "eq", true) | selectattr("name", "eq", "{{role}}") | list | count > 0
