--- - name: 🔎 Check whether the imported realm already exists shell: > {{ KEYCLOAK_EXEC_KCADM }} get realms/{{ KEYCLOAK_REALM }} register: keycloak_imported_realm_probe changed_when: false failed_when: false - name: "📂 Keycloak realm-import | Import missing realm + re-check login" when: - KEYCLOAK_REALM_IMPORT_ENABLED | bool - keycloak_imported_realm_probe.rc != 0 block: - name: "▶️ Keycloak realm-import | Run the import path ({{ DEPLOYMENT_MODE }})" ansible.builtin.include_tasks: "04_realm_import/{{ DEPLOYMENT_MODE }}.yml" - name: "▶️ Keycloak realm-import | Re-run login/bootstrap checks after import" ansible.builtin.include_tasks: utils/login.yml