AMW-612 Fix health URL duplication when hostname includes http_relative_path

Use removesuffix to strip overlapping path from hostname before
re-appending http_relative_path, preventing /auth/auth/ duplication.
Add molecule test for the relative path scenario.
This commit is contained in:
Martin Cihlar
2026-08-27 13:14:28 +02:00
parent a4cdf1b154
commit b48b0b7334
8 changed files with 128 additions and 3 deletions
@@ -115,7 +115,7 @@ argument_specs:
description: "HTTP port"
type: "int"
keycloak_quarkus_health_check_url:
default: "{{ keycloak_quarkus_hostname ~ keycloak_quarkus_http_relative_path.rstrip('/') ~ '/' ~ keycloak_quarkus_health_check_url_path }}"
default: "{{ keycloak_quarkus_hostname.rstrip('/').removesuffix(keycloak_quarkus_http_relative_path.rstrip('/')) ~ keycloak_quarkus_http_relative_path.rstrip('/') ~ '/' ~ keycloak_quarkus_health_check_url_path }}"
description: "Full URL (including scheme, host, path, fragment etc.) used for health check endpoint; keycloak_quarkus_hostname will NOT be prepended; helpful when health checks should happen against http port, but keycloak_quarkus_hostname uses https scheme per default"
type: "str"
keycloak_quarkus_health_check_url_path: