2022-04-07 12:07:08 +00:00
|
|
|
---
|
|
|
|
# tasks file for keycloak
|
|
|
|
- name: Check prerequisites
|
|
|
|
ansible.builtin.include_tasks: prereqs.yml
|
|
|
|
tags:
|
|
|
|
- prereqs
|
|
|
|
|
|
|
|
- name: Include firewall config tasks
|
|
|
|
ansible.builtin.include_tasks: firewalld.yml
|
|
|
|
when: keycloak_quarkus_configure_firewalld
|
|
|
|
tags:
|
|
|
|
- firewall
|
|
|
|
|
|
|
|
- name: Include install tasks
|
|
|
|
ansible.builtin.include_tasks: install.yml
|
|
|
|
tags:
|
|
|
|
- install
|
|
|
|
|
|
|
|
- name: Include systemd tasks
|
|
|
|
ansible.builtin.include_tasks: systemd.yml
|
|
|
|
tags:
|
|
|
|
- systemd
|
|
|
|
|
|
|
|
- name: "Configure config for keycloak service"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: keycloak.conf.j2
|
|
|
|
dest: "{{ keycloak.home }}/conf/keycloak.conf"
|
|
|
|
owner: "{{ keycloak.service_user }}"
|
|
|
|
group: "{{ keycloak.service_group }}"
|
|
|
|
mode: 0644
|
2022-06-30 14:15:48 +00:00
|
|
|
become: yes
|
2022-04-07 12:07:08 +00:00
|
|
|
notify:
|
|
|
|
- restart keycloak
|
|
|
|
|
2022-05-17 16:59:10 +00:00
|
|
|
- name: "Configure quarkus config for keycloak service"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: quarkus.properties.j2
|
|
|
|
dest: "{{ keycloak.home }}/conf/quarkus.properties"
|
|
|
|
owner: "{{ keycloak.service_user }}"
|
|
|
|
group: "{{ keycloak.service_group }}"
|
|
|
|
mode: 0644
|
2022-06-30 14:15:48 +00:00
|
|
|
become: yes
|
2022-05-17 16:59:10 +00:00
|
|
|
notify:
|
|
|
|
- restart keycloak
|
|
|
|
|
2022-05-31 17:07:18 +00:00
|
|
|
- name: Ensure logdirectory exists
|
|
|
|
ansible.builtin.file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ keycloak.home }}/{{ keycloak.log.file | dirname }}"
|
|
|
|
owner: "{{ keycloak.service_user }}"
|
|
|
|
group: "{{ keycloak.service_group }}"
|
|
|
|
mode: 0775
|
2022-06-30 14:15:48 +00:00
|
|
|
become: yes
|
2022-05-31 17:07:18 +00:00
|
|
|
|
2022-04-07 12:07:08 +00:00
|
|
|
- name: "Start and wait for keycloak service"
|
|
|
|
ansible.builtin.include_tasks: start.yml
|
|
|
|
|
|
|
|
- name: Check service status
|
|
|
|
ansible.builtin.command: "systemctl status keycloak"
|
|
|
|
register: keycloak_service_status
|
2022-05-17 16:59:10 +00:00
|
|
|
changed_when: False
|
|
|
|
|
|
|
|
- name: Link default logs directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
state: link
|
2022-05-31 17:07:18 +00:00
|
|
|
src: "{{ keycloak.home }}/{{ keycloak.log.file | dirname }}"
|
2022-05-17 16:59:10 +00:00
|
|
|
dest: /var/log/keycloak
|
2022-05-18 07:29:28 +00:00
|
|
|
force: yes
|
2022-06-30 14:15:48 +00:00
|
|
|
become: yes
|