48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
---
|
|
- name: Load distro-specific variables
|
|
ansible.builtin.include_vars: '{{ item }}'
|
|
tags: always
|
|
with_first_found:
|
|
- files:
|
|
- "{{ ansible_distribution }}.yaml"
|
|
skip: true
|
|
|
|
- name: Ensure Authentik is running on this device
|
|
block:
|
|
- name: Ensure presense of folders for Authentik Home
|
|
tags: packages,docker,authentik
|
|
ansible.builtin.file:
|
|
path: "/opt/authentik/{{ item }}"
|
|
state: directory
|
|
recurse: true
|
|
owner: root
|
|
group: root
|
|
loop:
|
|
- "media"
|
|
- "custom-templates"
|
|
- name: Ensure compose file is available on the server
|
|
tags: docker,authentik,settings
|
|
ansible.builtin.copy:
|
|
src: docker-compose.yaml
|
|
dest: /opt/authentik/docker-compose.yaml
|
|
owner: root
|
|
group: root
|
|
mode: u=rw,g=r,o=r
|
|
- name: Ensure environment file is available on the server
|
|
tags: docker,authentik,settings
|
|
ansible.builtin.template:
|
|
src: env.j2
|
|
dest: /opt/authentik/.env
|
|
owner: root
|
|
group: root
|
|
mode: u=rw,g=r,o=r
|
|
- name: Ensure docker containers are pulled and running
|
|
tags: docker,authentik
|
|
community.docker.docker_compose_v2:
|
|
project_src: /opt/authentik
|
|
pull: always
|
|
|
|
rescue:
|
|
- name: Set that this task failed
|
|
ansible.builtin.set_fact:
|
|
task_failed: true
|