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:
path: "{{ item }}"
path: "{{ nextcloud_data_dir }}"
state: directory
owner: root
group: root
mode: "0755"
loop:
- "{{ nextcloud_data_dir }}"
- "{{ nextcloud_data_dir }}/redis"
tags: nextcloud
- 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
# www-data inside the container is UID 33. The html directory must be owned by
@@ -22,7 +22,7 @@ services:
image: redis:7-alpine
container_name: nextcloud-redis
restart: unless-stopped
command: --save "" --loglevel warning
command: --save 60 1 --loglevel warning
volumes:
- {{ nextcloud_data_dir }}/redis:/data
networks: