2020-06-18 18:23:12 +02:00
|
|
|
---
|
2021-02-15 19:58:53 +01:00
|
|
|
- import_tasks: keycloak-install.yml
|
2022-09-23 13:52:06 +02:00
|
|
|
- import_tasks: keycloak-letsencrypt.yml
|
|
|
|
- import_tasks: keycloak-providers.yml
|
2021-02-15 19:58:53 +01:00
|
|
|
- import_tasks: keycloak-configuration.yml
|
2020-06-19 12:50:10 +02:00
|
|
|
|
2021-02-15 19:58:53 +01:00
|
|
|
- name: Manage the keycloak service
|
2020-06-19 19:10:02 +02:00
|
|
|
block:
|
2022-09-23 13:52:06 +02:00
|
|
|
- name: Install the keycloak systemd unit
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: keycloak.service.j2
|
2022-09-24 18:12:14 +02:00
|
|
|
dest: '/etc/systemd/system/{{ keycloak_service_name }}.service'
|
2021-02-15 19:58:53 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
2022-09-23 13:52:06 +02:00
|
|
|
mode: 0644
|
2020-06-19 19:27:34 +02:00
|
|
|
notify: Restart Keycloak
|
2020-06-19 19:10:02 +02:00
|
|
|
register: keycloak_unit
|
2020-06-19 12:50:10 +02:00
|
|
|
|
|
|
|
- name: Reload systemd
|
2022-09-23 13:52:06 +02:00
|
|
|
ansible.builtin.systemd:
|
2020-06-19 12:50:10 +02:00
|
|
|
daemon_reload: yes
|
2020-06-19 19:10:02 +02:00
|
|
|
when: keycloak_unit is changed
|
|
|
|
|
2022-09-24 18:12:14 +02:00
|
|
|
- name: ensure that the {{ keycloak_service_name }} service is running and enabled
|
2022-09-23 13:52:06 +02:00
|
|
|
ansible.builtin.service:
|
2022-09-24 18:12:14 +02:00
|
|
|
name: '{{ keycloak_service_name }}'
|
2022-09-23 13:52:06 +02:00
|
|
|
state: started
|
|
|
|
enabled: true
|
2020-06-19 12:50:10 +02:00
|
|
|
|
2022-09-23 13:52:06 +02:00
|
|
|
tags: ['keycloak', 'keycloak_service', 'keycloak_conf']
|