Compare commits

...

5 Commits

Author SHA1 Message Date
Guido Grazioli
cc6ddd3959 Merge pull request #10 from motaparthipavankumar/user-federation
User federation
2022-02-01 12:50:04 +01:00
Guido Grazioli
d3887ae9bd move client roles check out of loop 2022-02-01 09:19:26 +01:00
root
81005141c5 User federation 2022-01-31 14:16:36 -06:00
Guido Grazioli
ce6982ad51 fix: typo 2022-01-31 17:21:57 +01:00
Guido Grazioli
c2314ad068 fix: dict check for client users 2022-01-31 17:02:49 +01:00
3 changed files with 19 additions and 4 deletions

View File

@@ -34,6 +34,23 @@
status_code: 201
when: keycloak_realm_exists.status == 404
- name: Create user federation
community.general.keycloak_user_federation:
auth_keycloak_url: "{{ keycloak_url }}/auth"
auth_realm: "{{ keycloak_auth_realm }}"
auth_username: "{{ keycloak_admin_user }}"
auth_password: "{{ keycloak_admin_password }}"
realm: "{{ item.realm }}"
name: "{{ item.name }}"
state: present
provider_id: "{{ item.provider_id }}"
provider_type: "{{ item.provider_type | default(org.keycloak.storage.UserStorageProvider) }}"
config: "{{ item.config }}"
mappers: "{{ item.mappers | default(omit) }}"
register: create_user_federation_result
loop: "{{ keycloak_user_federation | flatten }}"
when: keycloak_user_federation is defined
- name: Create or update a Keycloak client
community.general.keycloak_client:
auth_client_id: "{{ keycloak_auth_client }}"
@@ -67,14 +84,14 @@
- name: Create client roles
include_tasks: manage_client_roles.yml
when: keycloak_rhsso_enable
loop: "{{ keycloak_clients | flatten }}"
loop_control:
loop_var: client
when: "'roles' in client"
- name: Create client users
include_tasks: manage_client_users.yml
loop: "{{ keycloak_clients | flatten }}"
loop_control:
loop_var: client
when: "'users' in keycloak_clients"
when: "'users' in client"

View File

@@ -10,4 +10,3 @@
auth_password: "{{ keycloak_admin_password }}"
state: present
loop: "{{ client.roles | flatten }}"
when: "'roles' in client"

View File

@@ -1,5 +1,4 @@
---
- name: "Get User {{ user.username }}"
uri:
url: "{{ keycloak_url }}/auth/admin/realms/{{ keycloak_realm }}/users?username={{ user.username }}"