mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-11-22 15:10:38 +00:00
Replace hostname-based health check URL with localhost. The health check runs on the managed host itself, so it should always target localhost rather than the public-facing keycloak_quarkus_hostname which can be empty or a domain name behind a load balancer. Compose the URL directly from existing production variables (keycloak_quarkus_http_enabled, keycloak_quarkus_http_port, keycloak_quarkus_https_port, keycloak_quarkus_http_relative_path) without introducing intermediate variables. Add .config/molecule/config.yml with shared molecule settings and a new quarkus_nohost test scenario that verifies the role works when keycloak_quarkus_hostname is left at its default empty value. Fixes #428
23 lines
713 B
YAML
23 lines
713 B
YAML
---
|
|
- name: Verify
|
|
hosts: all
|
|
tasks:
|
|
- name: Populate service facts
|
|
ansible.builtin.service_facts:
|
|
|
|
- name: Check if keycloak service started
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
|
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
|
|
|
- name: Verify health check endpoint is reachable on localhost
|
|
ansible.builtin.uri:
|
|
url: "http://localhost:8080/realms/master/.well-known/openid-configuration"
|
|
method: GET
|
|
validate_certs: false
|
|
register: keycloak_health_response
|
|
until: keycloak_health_response.status == 200
|
|
retries: 5
|
|
delay: 5
|