2021-02-15 19:58:53 +01:00
|
|
|
---
|
|
|
|
- name: Install the keycloak distribution
|
2022-11-29 17:28:27 +01:00
|
|
|
tags: keycloak
|
2021-02-15 19:58:53 +01:00
|
|
|
block:
|
|
|
|
- name: Create the keycloak user
|
2022-09-23 13:52:06 +02:00
|
|
|
ansible.builtin.user:
|
|
|
|
name: '{{ keycloak_user }}'
|
|
|
|
home: '{{ keycloak_install_dir }}'
|
|
|
|
createhome: false
|
|
|
|
shell: /usr/sbin/nologin
|
|
|
|
system: true
|
2021-02-15 19:58:53 +01:00
|
|
|
|
|
|
|
- name: Create the keycloak installation directory, if it does not already exist.
|
2022-09-23 13:52:06 +02:00
|
|
|
ansible.builtin.file:
|
|
|
|
dest: '{{ keycloak_install_dir }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
state: directory
|
|
|
|
recurse: true
|
2021-02-15 19:58:53 +01:00
|
|
|
|
2022-09-23 13:52:06 +02:00
|
|
|
- name: Create the keycloak log directory
|
|
|
|
file: dest={{ keycloak_log_directory }} state=directory owner={{ keycloak_user }} group={{ keycloak_user }} mode='0755'
|
2021-02-15 19:58:53 +01:00
|
|
|
|
|
|
|
- name: Download the keycloak distribution
|
|
|
|
unarchive: remote_src=yes src={{ keycloak_download_url }} dest={{ keycloak_install_dir }} owner=root group=root
|
|
|
|
args:
|
|
|
|
creates: '{{ keycloak_install_dir }}/{{ keycloak_distribution }}'
|
|
|
|
|
2022-09-23 13:52:06 +02:00
|
|
|
- name: Set the permissions of the {{ keycloak_data_directory }} directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: '{{ keycloak_data_directory }}'
|
|
|
|
state: directory
|
|
|
|
owner: '{{ keycloak_user }}'
|
|
|
|
group: '{{ keycloak_user }}'
|
|
|
|
mode: 0750
|
2022-11-29 18:46:11 +01:00
|
|
|
recurse: true
|
2022-09-23 13:52:06 +02:00
|
|
|
tags: [ keycloak, keycloak_data_dir ]
|
2021-02-15 19:58:53 +01:00
|
|
|
|
2022-11-29 17:28:27 +01:00
|
|
|
|
2022-09-24 20:04:51 +02:00
|
|
|
- name: Set the permissions of the {{ keycloak_runtime_home }}/lib/quarkus directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: '{{ keycloak_runtime_home }}/lib/quarkus'
|
|
|
|
state: directory
|
|
|
|
owner: '{{ keycloak_user }}'
|
|
|
|
group: '{{ keycloak_user }}'
|
|
|
|
mode: 0750
|
2022-11-29 18:46:11 +01:00
|
|
|
recurse: true
|
2022-09-24 20:04:51 +02:00
|
|
|
tags: [ keycloak, keycloak_data_dir ]
|
|
|
|
|
2022-09-23 13:52:06 +02:00
|
|
|
- name: Avatar directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: '{{ keycloak_external_avatar_dir }}'
|
|
|
|
state: directory
|
|
|
|
owner: '{{ keycloak_user }}'
|
|
|
|
group: '{{ keycloak_user }}'
|
|
|
|
mode: 0750
|
2022-10-11 10:57:02 +02:00
|
|
|
when: not keycloak_external_avatar_dir_enabled
|
2021-02-15 19:58:53 +01:00
|
|
|
|