Add the admin user.

This commit is contained in:
Andrea Dell'Amico 2020-06-19 20:13:43 +02:00
parent 1b43e86437
commit 4c56c0549a
2 changed files with 10 additions and 0 deletions

View File

@ -24,3 +24,6 @@ keycloak_database_user: keycloak_u
#keycloak_database_password: 'define it into a vault file'
keycloak_database_host: 'localhost'
keycloak_database_max_pool_size: '50'
keycloak_admin_user: kadmin
#keycloak_admin_password: 'define it into a vault file'

View File

@ -55,6 +55,13 @@
- standalone-ha.xml
notify: Restart Keycloak
- name: Create the admin user
shell: {{ keycloak_install_dir }}/{{ keycloak_distribution }}/bin/add-user-keycloak.sh -u {{ keycloak_admin_user }} -p {{ keycloak_admin_password }} && chown {{ keycloak_user }} {{ keycloak_install_dir }}/{{ keycloak_distribution }}/{{ keycloak_wildfly_mode }}/configuration/keycloak-add-user.json && chmod 600 {{ keycloak_install_dir }}/{{ keycloak_distribution }}/{{ keycloak_wildfly_mode }}/configuration/keycloak-add-user.json
args:
creates:'{{ keycloak_install_dir }}/{{ keycloak_distribution }}/{{ keycloak_wildfly_mode }}/configuration/keycloak-add-user.json'
notify: Restart Keycloak
tags: [ 'keycloak', 'keycloak_user', 'keycloak_conf' ]
tags: [ 'keycloak', 'keycloak_db', 'keycloak_conf' ]
- name: Manage the keycloak service