From 172614e4216909e0a010a2af923180c7bca54876 Mon Sep 17 00:00:00 2001 From: karpenok Date: Tue, 10 Nov 2026 19:50:40 +0700 Subject: [PATCH] fix(authentik): set proper ownership and permissions for media and custom-templates dirs --- ansible/roles/authentik/tasks/main.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ansible/roles/authentik/tasks/main.yml b/ansible/roles/authentik/tasks/main.yml index 3b5ad72..6567fb9 100644 --- a/ansible/roles/authentik/tasks/main.yml +++ b/ansible/roles/authentik/tasks/main.yml @@ -1,17 +1,17 @@ --- - name: Создать каталоги для сервиса Authentik ansible.builtin.file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory - owner: root - group: root - mode: "0750" + owner: "{{ item.owner | default('root') }}" + group: "{{ item.group | default('root') }}" + mode: "{{ item.mode | default('0750') }}" loop: - - "{{ authentik_dir }}" - - "{{ authentik_dir }}/db" - - "{{ authentik_dir }}/redis" - - "{{ authentik_dir }}/media" - - "{{ authentik_dir }}/custom-templates" + - { 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" } - name: Проверить наличие обязательных секретов Authentik ansible.builtin.assert: @@ -33,3 +33,4 @@ ansible.builtin.command: docker compose -f {{ authentik_dir }}/compose.yaml up -d --remove-orphans 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" +