---

- name: "Authenticate on keycloak for {{ inventory_hostname }}"
  include_role:
    name: keycloak
    tasks_from: _authenticate

- name: "Creating realm <{{ current_realm_name }}>"
  include_role:
    name: keycloak
    tasks_from: _configure_realm

- name: "Creating admin users for realm  <{{ current_realm_name }}>"
  include_role:
    name: keycloak
    tasks_from: _create_realm_admin
  when:
    - data is defined
    - data.admin is defined

- name: "Creating users for realm  <{{ current_realm_name }}>"
  include_role:
    name: keycloak
    tasks_from: _create_realm_users
  when:
    - data is defined
    - data.admin is defined
