diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 7e73d70..ac59d57 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -4,6 +4,12 @@ vars: keycloak_admin_password: "remembertochangeme" keycloak_jvm_package: java-11-openjdk-headless + keycloak_modcluster_enabled: True + keycloak_modcluster_urls: + - host: myhost1 + port: 16667 + - host: myhost2 + port: 16668 roles: - role: keycloak tasks: diff --git a/roles/keycloak/README.md b/roles/keycloak/README.md index 0104d75..53b8969 100644 --- a/roles/keycloak/README.md +++ b/roles/keycloak/README.md @@ -115,7 +115,8 @@ The following are a set of _required_ variables for the role: The following variables are _required_ only when `keycloak_ha_enabled` is True: | Variable | Description | Default | -|:---------|:------------|:---------| +|:---------|:------------|:--------| +|`keycloak_modcluster_enabled`| Enable configuration for modcluster subsystem | `True` if `keycloak_ha_enabled` is True, else `False` | |`keycloak_modcluster_url` | _deprecated_ Host for the modcluster reverse proxy | `localhost` | |`keycloak_modcluster_port` | _deprecated_ Port for the modcluster reverse proxy | `6666` | |`keycloak_modcluster_urls` | List of {host,port} dicts for the modcluster reverse proxies | `[ { localhost:6666 } ]` | diff --git a/roles/keycloak/defaults/main.yml b/roles/keycloak/defaults/main.yml index 67414cf..06320a1 100644 --- a/roles/keycloak/defaults/main.yml +++ b/roles/keycloak/defaults/main.yml @@ -55,6 +55,7 @@ keycloak_auth_client: admin-cli keycloak_force_install: False ### mod_cluster reverse proxy list +keycloak_modcluster_enabled: "{{ True if keycloak_ha_enabled else False }}" keycloak_modcluster_url: localhost keycloak_modcluster_port: 6666 keycloak_modcluster_urls: diff --git a/roles/keycloak/meta/argument_specs.yml b/roles/keycloak/meta/argument_specs.yml index 2413d48..1f6f10f 100644 --- a/roles/keycloak/meta/argument_specs.yml +++ b/roles/keycloak/meta/argument_specs.yml @@ -152,7 +152,7 @@ argument_specs: # line 48 of keycloak/defaults/main.yml default: "{{ True if keycloak_ha_enabled else False }}" description: "Enable auto configuration for database backend" - type: "str" + type: "bool" keycloak_admin_user: # line 51 of keycloak/defaults/main.yml default: "admin" @@ -173,6 +173,10 @@ argument_specs: default: false description: "Remove pre-existing versions of service" type: "bool" + keycloak_modcluster_enabled: + default: "{{ True if keycloak_ha_enabled else False }}" + description: "Enable configuration for modcluster subsystem" + type: "bool" keycloak_modcluster_url: # line 58 of keycloak/defaults/main.yml default: "localhost" diff --git a/roles/keycloak/vars/main.yml b/roles/keycloak/vars/main.yml index 52598bf..026839e 100644 --- a/roles/keycloak/vars/main.yml +++ b/roles/keycloak/vars/main.yml @@ -59,7 +59,7 @@ keycloak_jdbc: # reverse proxy mod_cluster keycloak_modcluster: - enabled: "{{ keycloak_ha_enabled }}" + enabled: "{{ keycloak_ha_enabled or keycloak_modcluster_enabled }}" reverse_proxy_urls: "{{ keycloak_modcluster_urls }}" frontend_url: "{{ keycloak_frontend_url }}"