From 2caf498bf330a767e49546a2436c4cf9eea2b819 Mon Sep 17 00:00:00 2001 From: erebion Date: Mon, 4 Sep 2023 22:33:53 +0200 Subject: [PATCH] Fix all the permissions... --- roles/docker_pretix/tasks/main.yml | 33 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/roles/docker_pretix/tasks/main.yml b/roles/docker_pretix/tasks/main.yml index ca01aeb..d7f5460 100644 --- a/roles/docker_pretix/tasks/main.yml +++ b/roles/docker_pretix/tasks/main.yml @@ -5,33 +5,38 @@ pkg: - docker.io -- name: "Create directories for Pretix" - ansible.builtin.file: - path: "{{ docker_volumes_dir }}/pretix" - state: directory - owner: root - group: root - mode: '0750' - recurse: true - -- name: "Create directories for Pretix" +- name: "Create directories for Pretix and give it access" ansible.builtin.file: path: "{{ item }}" state: directory owner: 15371 group: 15371 - mode: '0750' + mode: '0755' with_items: + - "{{ docker_volumes_dir }}/pretix" - "{{ docker_volumes_dir }}/pretix/data" - "{{ docker_volumes_dir }}/pretix/conf" + - "{{ docker_volumes_dir }}/pretix/data/cache" + - "{{ docker_volumes_dir }}/pretix/data/logs" + - "{{ docker_volumes_dir }}/pretix/data/media" + +- name: "Ensure Pretix has access to its files" + ansible.builtin.file: + path: "{{ item }}" + state: file + owner: 15371 + group: 15371 + mode: '0750' + with_items: + - "{{ docker_volumes_dir }}/pretix/data/.secret" - name: "Create directories for Pretix (Postgres DB)" ansible.builtin.file: path: "{{ item }}" state: directory - owner: 1337 #this is the ID Pretix uses - group: 1337 - mode: '0750' + owner: 999 + group: root + mode: '0700' with_items: - "{{ docker_volumes_dir }}/pretix/postgres-db"