Files
server_cloud_ladkau_de/ansible/roles/nextcloud/tasks/main.yml
T
ml 5ace691215 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
2026-06-28 17:26:01 +02:00

56 lines
1.4 KiB
YAML

---
- name: Create Nextcloud data directory
ansible.builtin.file:
path: "{{ nextcloud_data_dir }}"
state: directory
owner: root
group: root
mode: "0755"
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
# this user so Apache can traverse it and process .htaccess files.
- name: Create Nextcloud html directory (www-data UID 33)
ansible.builtin.file:
path: "{{ nextcloud_data_dir }}/html"
state: directory
owner: "33"
group: "33"
mode: "0755"
tags: nextcloud
- name: Create Nextcloud database directory (postgres UID 999)
ansible.builtin.file:
path: "{{ nextcloud_data_dir }}/db"
state: directory
owner: "999"
group: "999"
mode: "0700"
tags: nextcloud
- name: Deploy Docker Compose file
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ nextcloud_data_dir }}/docker-compose.yml"
owner: root
group: root
mode: "0644"
notify: Restart nextcloud
tags: nextcloud
- name: Start Nextcloud
community.docker.docker_compose_v2:
project_src: "{{ nextcloud_data_dir }}"
state: present
pull: missing
tags: nextcloud