Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dennis Hoppe
infrastructure
Commits
12dcdd83
Unverified
Commit
12dcdd83
authored
Nov 10, 2020
by
Dennis Hoppe
Browse files
Creation of admin user should be idempotent
parent
a6e49930
Pipeline
#2876
passed with stage
in 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/keycloak/tasks/main.yml
View file @
12dcdd83
...
...
@@ -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
.
Attach a 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