mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-07-26 14:41:31 -07:00
keycloak_quarkus_force_install does not ignore bootstrapped
This commit is contained in:
parent
55185a1439
commit
ef6d8890fb
4 changed files with 28 additions and 1 deletions
|
@ -182,7 +182,7 @@ Role Defaults
|
|||
|`keycloak_quarkus_config_dir` | Path for configuration | `{{ keycloak_quarkus_home }}/conf` |
|
||||
|`keycloak_quarkus_master_realm` | Name for rest authentication realm | `master` |
|
||||
|`keycloak_auth_client` | Authentication client for configuration REST calls | `admin-cli` |
|
||||
|`keycloak_force_install` | Remove pre-existing versions of service | `False` |
|
||||
|`keycloak_quarkus_force_install` | Remove pre-existing versions of service | `False` |
|
||||
|`keycloak_quarkus_proxy_mode`| The proxy address forwarding mode if the server is behind a reverse proxy | `edge` |
|
||||
|`keycloak_quarkus_start_dev`| Whether to start the service in development mode (start-dev) | `False` |
|
||||
|`keycloak_quarkus_transaction_xa_enabled`| Whether to use XA transactions | `True` |
|
||||
|
|
|
@ -194,3 +194,5 @@ keycloak_quarkus_restart_health_check: true
|
|||
keycloak_quarkus_restart_health_check_delay: 10
|
||||
keycloak_quarkus_restart_health_check_retries: 25
|
||||
keycloak_quarkus_restart_pause: 15
|
||||
|
||||
keycloak_quarkus_force_install: false
|
||||
|
|
|
@ -72,6 +72,10 @@ argument_specs:
|
|||
default: "admin"
|
||||
description: "Administration user account, only for bootstrapping"
|
||||
type: "str"
|
||||
keycloak_quarkus_force_install:
|
||||
default: false
|
||||
description: "Remove pre-existing versions of service"
|
||||
type: "bool"
|
||||
keycloak_quarkus_bootstrap_admin_password:
|
||||
required: true
|
||||
description: "Password of admin account, only for bootstrapping"
|
||||
|
|
|
@ -17,6 +17,27 @@
|
|||
path: "{{ keycloak.home }}"
|
||||
register: existing_deploy
|
||||
|
||||
- name: Stop and restart if existing deployment exists and install forced
|
||||
when: existing_deploy.stat.exists and keycloak_quarkus_force_install | bool
|
||||
block:
|
||||
- name: "Stop the old {{ keycloak.service_name }} service"
|
||||
become: true
|
||||
failed_when: false
|
||||
ansible.builtin.systemd:
|
||||
name: keycloak
|
||||
state: stopped
|
||||
- name: "Remove the old {{ keycloak.service_name }} deployment"
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ keycloak_quarkus_home }}"
|
||||
state: absent
|
||||
|
||||
- name: Check for an existing deployment after possible forced removal
|
||||
become: true
|
||||
ansible.builtin.stat:
|
||||
path: "{{ keycloak_quarkus_home }}"
|
||||
register: existing_deploy
|
||||
|
||||
- name: "Create {{ keycloak.service_name }} service user/group"
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue