From 2dce8dd9518ff25d779a7f40a263d97fb9389021 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Mon, 22 Apr 2024 22:09:07 +0200 Subject: [PATCH] CKAN role: fix storage path permissions This fixes an issue where it was not possible to create new organizations because of permission issues in the storage path. --- roles/ckan/tasks/main.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/roles/ckan/tasks/main.yml b/roles/ckan/tasks/main.yml index 21614ee..5d9c9f5 100644 --- a/roles/ckan/tasks/main.yml +++ b/roles/ckan/tasks/main.yml @@ -23,11 +23,15 @@ - name: Ensure CKAN storage path is present ansible.builtin.file: - path: "{{ ckan_storage_path }}" + path: "{{ item }}" state: directory owner: www-data group: www-data mode: "0775" + with_items: + - "{{ ckan_storage_path }}" + - "{{ ckan_storage_path }}/storage" + - "{{ ckan_storage_path }}/webassets" - name: Install CKAN package @@ -344,3 +348,12 @@ minute: "0" user: root job: "find /tmp/default/sessions -type f -mtime +1 -delete" + + +- name: Fix up permissions CKAN storage directory + ansible.builtin.file: + dest: "{{ ckan_storage_path }}" + owner: www-data + group: www-data + mode: "u=rwX,g=rX,o=rX" + recurse: true