ansible-role-keycloak/tasks/main.yml

31 lines
869 B
YAML
Raw Normal View History

2020-06-18 18:23:12 +02:00
---
- import_tasks: keycloak-install.yml
2022-09-23 13:52:06 +02:00
- import_tasks: keycloak-letsencrypt.yml
- import_tasks: keycloak-providers.yml
- import_tasks: keycloak-configuration.yml
2020-06-19 12:50:10 +02:00
- name: Manage the keycloak service
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'
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
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
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']