adding Authelia to dal14
This commit is contained in:
55
roles/authelia/tasks/main.yml
Normal file
55
roles/authelia/tasks/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
- name: Create authelia directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0750"
|
||||
loop:
|
||||
- "{{ authelia_base_dir }}"
|
||||
- "{{ authelia_config_dir }}"
|
||||
- "{{ authelia_data_dir }}"
|
||||
|
||||
- name: Deploy configuration.yml
|
||||
ansible.builtin.template:
|
||||
src: configuration.yml.j2
|
||||
dest: "{{ authelia_config_dir }}/configuration.yml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0640"
|
||||
notify: restart authelia
|
||||
|
||||
- name: Deploy users_database.yml
|
||||
ansible.builtin.template:
|
||||
src: users_database.yml.j2
|
||||
dest: "{{ authelia_config_dir }}/users_database.yml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0640"
|
||||
notify: restart authelia
|
||||
when: authelia_users is defined
|
||||
|
||||
- name: Deploy docker-compose.yml
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ authelia_base_dir }}/docker-compose.yml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0640"
|
||||
register: compose_file
|
||||
|
||||
- name: Pull and start authelia via docker compose
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ authelia_base_dir }}"
|
||||
state: present
|
||||
pull: missing
|
||||
|
||||
- name: Deploy Caddyfile
|
||||
ansible.builtin.template:
|
||||
src: Caddyfile.j2
|
||||
dest: "{{ authelia_base_dir }}/Caddyfile"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0640"
|
||||
notify: restart authelia
|
||||
Reference in New Issue
Block a user