ansible-middleware / keycloak

Collection to install and configure Keycloak or Red Hat Single Sign-On / Red Hat Build of Keycloak
Apache License 2.0
82 stars 49 forks source link

Restart handler strategy behaviour #231

Closed guidograzioli closed 2 weeks ago

guidograzioli commented 2 weeks ago

Builds on and supersedes #230; a directory for restart strategies is provided with three implementations: none (nothing is restarted), serial (restart hosts in a serial fashion), serial_then_parallel (restart first node, verify health url, proceed with the rest in parallel). Restart health check can be mix-and-matched with the wait_for parameters.

The default strategy file, imported from the restart handler, is 'serial_then_parallel'; user can use that, choose one of the other too, or specify their custom taskfile (in a relative path of the calling playbook).

The molecule scenario quarkus_ha tests a cluster of two keycloak instances with a shared postgresql instance, restart in serial strategy

New parameters:

Variable Description Default
keycloak_quarkus_restart_strategy Strategy task file for restarting in HA (one of provided restart/['serial.yml','none.yml','serial_then_parallel.yml']) or path to file when providing custom strategy restart/serial.yml
keycloak_quarkus_restart_health_check Whether to wait for successful health check after restart {{ keycloak_quarkus_ha_enabled }}
keycloak_quarkus_restart_health_check_delay Seconds to let pass before starting healch checks 10
keycloak_quarkus_restart_health_check_reries Number of attempts for successful health check before failing 25
keycloak_quarkus_restart_pause Seconds to wait between restarts in HA strategy 15

Fix #182 Fix #221

guidograzioli commented 2 weeks ago

@hwo-wd please review; if we agree on this coauthored PR, I'll find another pair of eye to do the formal review

guidograzioli commented 2 weeks ago

@hwo-wd I believe all your notes were addressed, and we got the green flag from Andy; if you have other commits to push or comments please do; or, I'll proceed and merge. This has been pretty epic :)

hwo-wd commented 2 weeks ago

lgtm, thanks for the journey :)