Fix Nextcloud Redis snapshot permissions and provisioning issues

- Create Redis data directory with correct ownership (UID 999) so Redis
  can write RDB snapshots; root-owned directory caused stop-writes-on-bgsave-error
  which crash-looped Nextcloud background jobs at 400%+ CPU
This commit is contained in:
ml
2026-06-28 17:24:52 +02:00
parent c77b82d835
commit 5ace691215
2 changed files with 12 additions and 6 deletions
+11 -5
View File
@@ -1,14 +1,20 @@
--- ---
- name: Create Nextcloud data directories - name: Create Nextcloud data directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ item }}" path: "{{ nextcloud_data_dir }}"
state: directory state: directory
owner: root owner: root
group: root group: root
mode: "0755" mode: "0755"
loop: tags: nextcloud
- "{{ nextcloud_data_dir }}"
- "{{ nextcloud_data_dir }}/redis" - name: Create Nextcloud Redis directory (redis UID 999)
ansible.builtin.file:
path: "{{ nextcloud_data_dir }}/redis"
state: directory
owner: "999"
group: "999"
mode: "0700"
tags: nextcloud tags: nextcloud
# www-data inside the container is UID 33. The html directory must be owned by # www-data inside the container is UID 33. The html directory must be owned by
@@ -22,7 +22,7 @@ services:
image: redis:7-alpine image: redis:7-alpine
container_name: nextcloud-redis container_name: nextcloud-redis
restart: unless-stopped restart: unless-stopped
command: --save "" --loglevel warning command: --save 60 1 --loglevel warning
volumes: volumes:
- {{ nextcloud_data_dir }}/redis:/data - {{ nextcloud_data_dir }}/redis:/data
networks: networks: