Allow overrides for service start retries and delay

This commit is contained in:
Romain Pelisse 2022-12-16 15:14:44 +01:00
parent 8ed82d937c
commit 46d5af90ba
4 changed files with 15 additions and 5 deletions

View file

@ -21,6 +21,8 @@ keycloak_service_group: keycloak
keycloak_service_pidfile: "/run/keycloak.pid"
keycloak_service_name: keycloak
keycloak_service_desc: Keycloak
keycloak_service_start_delay: 10
keycloak_service_start_retries: 25
keycloak_configure_firewalld: False

View file

@ -266,6 +266,14 @@ argument_specs:
default: "Keycloak"
description: "systemd description for keycloak"
type: "str"
keycloak_service_start_delay:
default: "10"
description: "Expected delay in ms before the service is expected to be available after start."
type: "int"
keycloak_service_start_retries:
default: "25"
description: "How many time should Ansible retry to connect to the service after it was started, before failing."
type: "int"
keycloak_no_log:
default: true
type: "bool"

View file

@ -15,8 +15,8 @@
until: keycloak_status.status == 200
delegate_to: "{{ ansible_play_hosts | first }}"
run_once: True
retries: 25
delay: 10
retries: "{{ keycloak_service_start_retries }}"
delay: "{{ keycloak_service_start_delay }}"
- name: "Restart and enable {{ keycloak.service_name }} service"
ansible.builtin.systemd:

View file

@ -11,5 +11,5 @@
url: "{{ keycloak.health_url }}"
register: keycloak_status
until: keycloak_status.status == 200
retries: 25
delay: 10
retries: "{{ keycloak_service_start_retries }}"
delay: "{{ keycloak_service_start_delay }}"