fix(authentik): recursively enforce correct UIDs for postgres and redis data dirs
ansible-core-net / deploy (push) Failing after 30s

This commit is contained in:
karpenok committed 2026-11-10 19:56:20 +07:00
1 parent 172614e421
commit f7505333db
4 files changed
+19 -9

No files matched your search

@@ -4,3 +4,4 @@ authentik_dir: "/opt/authentik"
authentik_http_port: 9000
authentik_secret_key: "{{ lookup('env', 'AUTHENTIK_SECRET_KEY') }}"
authentik_postgres_password: "{{ lookup('env', 'AUTHENTIK_POSTGRES_PASSWORD') }}"
+16 -9
View File
@@ -1,17 +1,19 @@
---
- name: Создать каталоги для сервиса Authentik
- name: Создать каталоги для сервиса Authentik с корректными правами
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default('root') }}"
mode: "{{ item.mode | default('0750') }}"
owner: "{{ item.owner }}"
group: "{{ item.group }}"
mode: "{{ item.mode }}"
recurse: "{{ item.recurse | default(false) }}"
loop:
- { path: "{{ authentik_dir }}", mode: "0755" }
- { path: "{{ authentik_dir }}/db", mode: "0700" }
- { path: "{{ authentik_dir }}/redis", mode: "0700" }
- { path: "{{ authentik_dir }}/media", owner: "1000", group: "1000", mode: "0775" }
- { path: "{{ authentik_dir }}/custom-templates", owner: "1000", group: "1000", mode: "0775" }
- { path: "{{ authentik_dir }}", owner: "root", group: "root", mode: "0755" }
- { path: "{{ authentik_dir }}/db", owner: "70", group: "70", mode: "0700", recurse: true }
- { path: "{{ authentik_dir }}/redis", owner: "999", group: "999", mode: "0700", recurse: true }
- { path: "{{ authentik_dir }}/media", owner: "1000", group: "1000", mode: "0775", recurse: true }
- { path: "{{ authentik_dir }}/custom-templates", owner: "1000", group: "1000", mode: "0775", recurse: true }
register: authentik_dirs
- name: Проверить наличие обязательных секретов Authentik
ansible.builtin.assert:
@@ -34,3 +36,8 @@
register: compose_up
changed_when: "'Started' in compose_up.stderr or 'Created' in compose_up.stderr or 'Recreated' in compose_up.stderr or 'Pulled' in compose_up.stderr"
- name: Перезапустить базу и сервер Authentik при изменении прав
ansible.builtin.command: docker compose -f {{ authentik_dir }}/compose.yaml restart authentik-db authentik-server
when: authentik_dirs.changed
@@ -85,3 +85,4 @@ networks:
authentik-net:
name: authentik-net
driver: bridge
@@ -31,3 +31,4 @@ http:
- "X-authentik-meta-provider"
- "X-authentik-meta-app"
- "X-authentik-meta-version"