2021-12-14 10:26:42 +00:00
|
|
|
---
|
2022-03-17 09:45:55 +00:00
|
|
|
- name: "Restart and enable {{ keycloak.service_name }} service"
|
2022-02-24 14:00:10 +00:00
|
|
|
ansible.builtin.systemd:
|
2021-12-14 10:26:42 +00:00
|
|
|
name: keycloak
|
|
|
|
enabled: yes
|
|
|
|
state: restarted
|
|
|
|
become: yes
|
2022-09-28 14:30:26 +00:00
|
|
|
delegate_to: "{{ ansible_play_hosts | first }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: "Wait until {{ keycloak.service_name }} becomes active {{ keycloak.health_url }}"
|
|
|
|
ansible.builtin.uri:
|
|
|
|
url: "{{ keycloak.health_url }}"
|
|
|
|
register: keycloak_status
|
|
|
|
until: keycloak_status.status == 200
|
|
|
|
delegate_to: "{{ ansible_play_hosts | first }}"
|
|
|
|
run_once: True
|
|
|
|
retries: 25
|
|
|
|
delay: 10
|
|
|
|
|
|
|
|
- name: "Restart and enable {{ keycloak.service_name }} service"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: keycloak
|
|
|
|
enabled: yes
|
|
|
|
state: restarted
|
|
|
|
become: yes
|
2022-09-28 14:48:40 +00:00
|
|
|
when: inventory_hostname != ansible_play_hosts | first
|