ansible-role-keycloak/tasks/keycloak-install.yml

59 lines
1.8 KiB
YAML
Raw Normal View History

---
- name: Install the keycloak distribution
tags: keycloak
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
- 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
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'
- 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 ]
- 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
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