diff --git a/roles/keycloak/README.md b/roles/keycloak/README.md
index 3f3c269..6b0bbd9 100644
--- a/roles/keycloak/README.md
+++ b/roles/keycloak/README.md
@@ -47,6 +47,7 @@ The following variables are _required_ only when `keycloak_ha_enabled` is True:
| Variable | Description | Default |
|:---------|:------------|:---------|
|`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` |
|`infinispan_url` | URL for the infinispan remote-cache server | `localhost:11122` |
|`infinispan_user` | username for connecting to infinispan | `supervisor` |
diff --git a/roles/keycloak/defaults/main.yml b/roles/keycloak/defaults/main.yml
index b2f45e8..f04c2eb 100644
--- a/roles/keycloak/defaults/main.yml
+++ b/roles/keycloak/defaults/main.yml
@@ -50,6 +50,7 @@ keycloak_force_install: False
### mod_cluster reverse proxy
keycloak_modcluster_url: localhost
+keycloak_frontend_url: localhost
### infinispan remote caches access (hotrod)
infinispan_user: supervisor
diff --git a/roles/keycloak/tasks/systemd.yml b/roles/keycloak/tasks/systemd.yml
index 3cf1479..858f5d7 100644
--- a/roles/keycloak/tasks/systemd.yml
+++ b/roles/keycloak/tasks/systemd.yml
@@ -38,6 +38,9 @@
daemon_reload: yes
when: systemdunit.changed
+- set_fact:
+ health_url: "{{ keycloak_management_url }}/health"
+
- name: start keycloak
systemd:
name: keycloak
@@ -56,9 +59,6 @@
- meta: flush_handlers
-- set_fact:
- health_url: "{{ keycloak_management_url }}/health"
-
- name: "Wait until Keycloak becomes active {{ health_url }}"
uri:
url: "{{ health_url }}"
diff --git a/roles/keycloak/templates/standalone-infinispan.xml.j2 b/roles/keycloak/templates/standalone-infinispan.xml.j2
index e7d2a8c..2b2842b 100644
--- a/roles/keycloak/templates/standalone-infinispan.xml.j2
+++ b/roles/keycloak/templates/standalone-infinispan.xml.j2
@@ -609,8 +609,8 @@
default
-
-
+
+
diff --git a/roles/keycloak/templates/standalone-rhsso-jdg.xml.j2 b/roles/keycloak/templates/standalone-rhsso-jdg.xml.j2
index 09884b5..e73bf19 100644
--- a/roles/keycloak/templates/standalone-rhsso-jdg.xml.j2
+++ b/roles/keycloak/templates/standalone-rhsso-jdg.xml.j2
@@ -606,8 +606,8 @@
default
-
-
+
+
diff --git a/roles/keycloak/templates/standalone-rhsso.xml.j2 b/roles/keycloak/templates/standalone-rhsso.xml.j2
index 95eb4e0..b48883a 100644
--- a/roles/keycloak/templates/standalone-rhsso.xml.j2
+++ b/roles/keycloak/templates/standalone-rhsso.xml.j2
@@ -505,8 +505,8 @@
default
-
-
+
+
diff --git a/roles/keycloak/templates/standalone.xml.j2 b/roles/keycloak/templates/standalone.xml.j2
index bf3ce0a..823357f 100644
--- a/roles/keycloak/templates/standalone.xml.j2
+++ b/roles/keycloak/templates/standalone.xml.j2
@@ -583,8 +583,8 @@
default
-
-
+
+
diff --git a/roles/keycloak/vars/main.yml b/roles/keycloak/vars/main.yml
index f135d99..cf1d6cc 100644
--- a/roles/keycloak/vars/main.yml
+++ b/roles/keycloak/vars/main.yml
@@ -55,6 +55,7 @@ keycloak_jdbc:
keycloak_modcluster:
enabled: "{{ keycloak_ha_enabled }}"
reverse_proxy_url: "{{ keycloak_modcluster_url }}"
+ frontend_url: "{{ keycloak_frontend_url }}"
# infinispan
keycloak_remotecache: