ansible-middleware/keycloak

When https is not enabled, systemd never starts the service

Closed this issue · 1 comments

SUMMARY

The new systemd service checks the service on port 8443, however when terminating SSL at proxy level, https does not need to be started.

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible [core 2.16.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.4 (main, Jun  7 2024, 00:00:00) [GCC 14.1.1 20240607 (Red Hat 14.1.1-5)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

COLLECTION VERSION
middleware_automation.common             1.2.1  
middleware_automation.keycloak           2.4.1  

STEPS TO REPRODUCE
  • Do not enable https on keycloak
  • Try to run minimal playbook
  • Keycloak will start, but the systemd timer will not see port 8443 up and will bring the service down
FIX

Adding or changing line 26 on

https://github.com/ansible-middleware/keycloak/blob/main/roles/keycloak_quarkus/templates/keycloak.service.j2

fixes this.

Hello thanks for reporting; workaround is to set keycloak_quarkus_systemd_wait_for_port to false to disable the test.
The solution will add a parater to set an arbitrary port to test