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

46 lines
1.4 KiB
YAML
Raw Normal View History

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