---
|
- name: Get codeready SSO admin token
|
uri:
|
url: http://keycloak-codeready.{{ route_subdomain }}/auth/realms/master/protocol/openid-connect/token
|
method: POST
|
body:
|
username: "{{ codeready_sso_admin_username }}"
|
password: "{{ codeready_sso_admin_password }}"
|
grant_type: "password"
|
client_id: "admin-cli"
|
body_format: form-urlencoded
|
status_code: 200,201,204
|
register: codeready_sso_admin_token
|
|
- name: Add user {{ user }} to Che
|
uri:
|
url: http://keycloak-codeready.{{ route_subdomain }}/auth/admin/realms/codeready/users
|
method: POST
|
headers:
|
Content-Type: application/json
|
Authorization: "Bearer {{ codeready_sso_admin_token.json.access_token }}"
|
body:
|
username: "{{ user }}"
|
enabled: true
|
emailVerified: true
|
firstName: "{{ user }}"
|
lastName: Developer
|
email: "{{ user }}@no-reply.com"
|
credentials:
|
- type: password
|
value: "{{ workshop_che_user_password }}"
|
temporary: false
|
body_format: json
|
status_code: 201,409
|