Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dennis Hoppe
infrastructure
Commits
3745e5f6
Commit
3745e5f6
authored
Nov 10, 2020
by
Dennis Hoppe
Committed by
Sven-Hendrik Haase
Nov 11, 2020
Browse files
Creation of admin user should be idempotent
parent
ba1f1a5b
Pipeline
#2880
passed with stage
in 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/keycloak/tasks/main.yml
View file @
3745e5f6
...
...
@@ -18,10 +18,22 @@
notify
:
-
restart keycloak
-
name
:
request a bearer token
uri
:
url
:
http://127.0.0.1:8080/auth/realms/master/protocol/openid-connect/token
method
:
POST
body_format
:
form-urlencoded
body
:
username
:
"
{{
vault_keycloak_admin_user
}}"
password
:
"
{{
vault_keycloak_admin_password
}}"
grant_type
:
password
client_id
:
admin-cli
ignore_errors
:
True
register
:
token
-
name
:
create an admin user
command
:
/opt/keycloak/bin/add-user-keycloak.sh -r master -u "{{ vault_keycloak_admin_user }}" -p "{{ vault_keycloak_admin_password }}"
args
:
creates
:
/opt/keycloak/standalone/configuration/keycloak-add-user.json
when
:
token.status ==
401
-
name
:
start and enable keycloak
service
:
name=keycloak enabled=yes state=started
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment