Skip to content

Instantly share code, notes, and snippets.

@odra
Created November 23, 2018 11:42
Show Gist options
  • Save odra/aff22a493b372739e8b8dbf12e27cbeb to your computer and use it in GitHub Desktop.
Save odra/aff22a493b372739e8b8dbf12e27cbeb to your computer and use it in GitHub Desktop.
-
name: Set apicurio client id var
set_fact:
apicurio_kc_client: "{{ item.id }}"
with_items: "{{ (sso_kc_realm_cmd.stdout | from_json).spec.clients }}"
when: item.id == apicurio_kc_client_id
-
name: Inject apicurio client in CR if it does not exist
shell: "oc patch keycloakrealm {{ apicurio_kc_realm }} -n {{ apicurio_keycloak_namespace }} --type=json -p '[{\"op\": \"add\", \"path\": \"/spec/clients/-\", \"value\": {{ lookup('file', apicurio_kc_cient_json_path) }}}]'"
register: result
until: not result.stderr
retries: 50
delay: 10
failed_when: result.stderr
changed_when: result.stdout
when: apicurio_kc_client is undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment