ansible-role-keycloak/tasks/main.yml

31 lines
869 B
YAML

---
- import_tasks: keycloak-install.yml
- import_tasks: keycloak-letsencrypt.yml
- import_tasks: keycloak-providers.yml
- import_tasks: keycloak-configuration.yml
- name: Manage the keycloak service
block:
- name: Install the keycloak systemd unit
ansible.builtin.template:
src: keycloak.service.j2
dest: '/etc/systemd/system/{{ keycloak_service_name }}.service'
owner: root
group: root
mode: 0644
notify: Restart Keycloak
register: keycloak_unit
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: yes
when: keycloak_unit is changed
- name: ensure that the {{ keycloak_service_name }} service is running and enabled
ansible.builtin.service:
name: '{{ keycloak_service_name }}'
state: started
enabled: true
tags: ['keycloak', 'keycloak_service', 'keycloak_conf']