# This file sets the correct ownership rights for Moodle volumes - name: Set ownership and permissions on Moodle directories vars: MOODLE_DIRS: - "{{ BITNAMI_CODE_DIR }}" - "{{ BITNAMI_DATA_DIR }}" block: - name: Ensure ownership is correct command: "docker exec --user root {{ MOODLE_CONTAINER }} chown -R {{ BITNAMI_USER_GROUP }} {{ item }}" loop: "{{ MOODLE_DIRS }}" - name: Set directory permissions (770) command: "docker exec --user root {{ MOODLE_CONTAINER }} find {{ item }} -type d -exec chmod 770 {} \\;" loop: "{{ MOODLE_DIRS }}" - name: Set file permissions (660) command: "docker exec --user root {{ MOODLE_CONTAINER }} find {{ item }} -type f -exec chmod 660 {} \\;" loop: "{{ MOODLE_DIRS }}"