Add variable for frontendUrl (for revproxy scenario)

main
Guido Grazioli 2022-01-13 17:38:11 +01:00
parent ead4688ce6
commit bcd82a5ae5
8 changed files with 14 additions and 11 deletions

View File

@ -47,6 +47,7 @@ The following variables are _required_ only when `keycloak_ha_enabled` is True:
| Variable | Description | Default | | Variable | Description | Default |
|:---------|:------------|:---------| |:---------|:------------|:---------|
|`keycloak_modcluster_url` | URL for the modcluster reverse proxy | `localhost` | |`keycloak_modcluster_url` | URL for the modcluster reverse proxy | `localhost` |
|`keycloak_frontend_url` | frontend URL for keycloak endpoints when a reverse proxy is used | `localhost` |
|`keycloak_jdbc_engine` | backend database flavour when db is enabled: [ postgres, mariadb ] | `postgres` | |`keycloak_jdbc_engine` | backend database flavour when db is enabled: [ postgres, mariadb ] | `postgres` |
|`infinispan_url` | URL for the infinispan remote-cache server | `localhost:11122` | |`infinispan_url` | URL for the infinispan remote-cache server | `localhost:11122` |
|`infinispan_user` | username for connecting to infinispan | `supervisor` | |`infinispan_user` | username for connecting to infinispan | `supervisor` |

View File

@ -50,6 +50,7 @@ keycloak_force_install: False
### mod_cluster reverse proxy ### mod_cluster reverse proxy
keycloak_modcluster_url: localhost keycloak_modcluster_url: localhost
keycloak_frontend_url: localhost
### infinispan remote caches access (hotrod) ### infinispan remote caches access (hotrod)
infinispan_user: supervisor infinispan_user: supervisor

View File

@ -38,6 +38,9 @@
daemon_reload: yes daemon_reload: yes
when: systemdunit.changed when: systemdunit.changed
- set_fact:
health_url: "{{ keycloak_management_url }}/health"
- name: start keycloak - name: start keycloak
systemd: systemd:
name: keycloak name: keycloak
@ -56,9 +59,6 @@
- meta: flush_handlers - meta: flush_handlers
- set_fact:
health_url: "{{ keycloak_management_url }}/health"
- name: "Wait until Keycloak becomes active {{ health_url }}" - name: "Wait until Keycloak becomes active {{ health_url }}"
uri: uri:
url: "{{ health_url }}" url: "{{ health_url }}"

View File

@ -609,8 +609,8 @@
<default-provider>default</default-provider> <default-provider>default</default-provider>
<provider name="default" enabled="true"> <provider name="default" enabled="true">
<properties> <properties>
<property name="frontendUrl" value="${keycloak.frontendUrl:}"/> <property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
<property name="forceBackendUrlToFrontendUrl" value="false"/> <property name="forceBackendUrlToFrontendUrl" value="true"/>
</properties> </properties>
</provider> </provider>
</spi> </spi>

View File

@ -606,8 +606,8 @@
<default-provider>default</default-provider> <default-provider>default</default-provider>
<provider name="default" enabled="true"> <provider name="default" enabled="true">
<properties> <properties>
<property name="frontendUrl" value="${keycloak.frontendUrl:}"/> <property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
<property name="forceBackendUrlToFrontendUrl" value="false"/> <property name="forceBackendUrlToFrontendUrl" value="true"/>
</properties> </properties>
</provider> </provider>
</spi> </spi>

View File

@ -505,8 +505,8 @@
<default-provider>default</default-provider> <default-provider>default</default-provider>
<provider name="default" enabled="true"> <provider name="default" enabled="true">
<properties> <properties>
<property name="frontendUrl" value="${keycloak.frontendUrl:}"/> <property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
<property name="forceBackendUrlToFrontendUrl" value="false"/> <property name="forceBackendUrlToFrontendUrl" value="true"/>
</properties> </properties>
</provider> </provider>
</spi> </spi>

View File

@ -583,8 +583,8 @@
<default-provider>default</default-provider> <default-provider>default</default-provider>
<provider name="default" enabled="true"> <provider name="default" enabled="true">
<properties> <properties>
<property name="frontendUrl" value="${keycloak.frontendUrl:}"/> <property name="frontendUrl" value="{{ keycloak_modcluster.frontend_url }}"/>
<property name="forceBackendUrlToFrontendUrl" value="false"/> <property name="forceBackendUrlToFrontendUrl" value="true"/>
</properties> </properties>
</provider> </provider>
</spi> </spi>

View File

@ -55,6 +55,7 @@ keycloak_jdbc:
keycloak_modcluster: keycloak_modcluster:
enabled: "{{ keycloak_ha_enabled }}" enabled: "{{ keycloak_ha_enabled }}"
reverse_proxy_url: "{{ keycloak_modcluster_url }}" reverse_proxy_url: "{{ keycloak_modcluster_url }}"
frontend_url: "{{ keycloak_frontend_url }}"
# infinispan # infinispan
keycloak_remotecache: keycloak_remotecache: