feat: add Nextcloud service configuration and deployment tasks
Some checks failed
Python Lint Check / check-python (push) Waiting to run
Ansible Lint Check / check-ansible (push) Failing after 58s
Nix Format Check / check-format (push) Has been cancelled

This commit is contained in:
Menno van Leeuwen 2025-03-14 01:03:21 +01:00
parent 3e48b16a61
commit 27649f31fc
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
4 changed files with 54 additions and 0 deletions

View File

@ -29,3 +29,5 @@
enabled: false
- name: jellyfin
enabled: true
- name: nextcloud
enabled: true

View File

@ -17,3 +17,8 @@ jf.vleeuwen.me jf.mvl.sh {
reverse_proxy jellyfin:8096
tls {{ caddy_email }}
}
cloud.vleeuwen.me cloud.mvl.sh {
reverse_proxy nextcloud-aio-mastercontainer:80
tls {{ caddy_email }}
}

View File

@ -0,0 +1,19 @@
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly
volumes:
- /mnt/object_storage/services/nextcloud:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work
- /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'!
network_mode: bridge # add to the same network as docker run would do
ports:
- 8080:8080
networks:
- caddy_network
networks:
caddy_network:
external: true
name: caddy_default

View File

@ -0,0 +1,28 @@
---
- name: Deploy Nextcloud service
block:
- name: Set Nextcloud directories
ansible.builtin.set_fact:
nextcloud_service_dir: "{{ ansible_env.HOME }}/services/nextcloud"
nextcloud_data_dir: "/mnt/object_storage/services/nextcloud"
- name: Create Nextcloud directory
ansible.builtin.file:
path: "{{ nextcloud_service_dir }}"
state: directory
mode: "0755"
- name: Deploy Nextcloud docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ nextcloud_service_dir }}/docker-compose.yml"
mode: "0644"
register: nextcloud_compose
- name: Stop Nextcloud service
ansible.builtin.command: docker compose -f "{{ nextcloud_service_dir }}/docker-compose.yml" down --remove-orphans
when: nextcloud_compose.changed
- name: Start Nextcloud service
ansible.builtin.command: docker compose -f "{{ nextcloud_service_dir }}/docker-compose.yml" up -d
when: nextcloud_compose.changed