Replace docker rclone volumes with native cifs volumes

This commit is contained in:
Tobias Reisinger 2026-01-25 12:22:18 +01:00
parent 85568c8278
commit 635a0c4da8
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
12 changed files with 19 additions and 106 deletions

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
backup_path="$1"
stage="$2"
if [ "$stage" == "before" ]; then
rclone mount --config /opt/services/backup/rclone.conf --daemon immich_upload: "$backup_path"
fi
if [ "$stage" == "after" ]; then
unmount "$backup_path"
fi

View file

@ -25,12 +25,6 @@
content: '{{ backup_yml_all | to_nice_yaml }}'
mode: "0644"
- name: Create rclone.conf
ansible.builtin.copy:
dest: "{{ (service_path, 'rclone.conf') | path_join }}"
content: '{{ vault_backup.rclone }}'
mode: "0600"
- name: Import tasks specific to the hooks scripts
ansible.builtin.import_tasks: hooks.yml
- name: Import tasks specific to the recovery scripts

View file

@ -15,9 +15,12 @@ calibre_web_compose:
image: lscr.io/linuxserver/calibre-web:latest
volumes:
- config:/config
- calibre_web_data:/data
- data:/data
file:
volumes:
config:
calibre_web_data:
external: true
data:
driver_opts:
type: cifs
o: "username={{ opentofu.hcloud_storage_box_accounts.calibre_web.user }},password={{ opentofu.hcloud_storage_box_accounts.calibre_web.pass }}"
device: "//{{ opentofu.hcloud_storage_box_accounts.calibre_web.host }}/{{ opentofu.hcloud_storage_box_accounts.calibre_web.user }}"

View file

@ -8,10 +8,5 @@
env: "{{ calibre_web_env }}"
compose: "{{ calibre_web_compose }}"
block:
- name: Import tasks to create docker rclone volume
ansible.builtin.import_tasks: tasks/create-docker-rclone-volume.yml
vars:
task_volume: calibre_web_data
task_rclone: "{{ opentofu.hcloud_storage_box_accounts.calibre_web }}"
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -29,7 +29,7 @@ immich_compose:
watchtower: monitor
image: ghcr.io/immich-app/immich-server:{{ immich_docker_tag }}
volumes:
- immich_upload:/usr/src/app/upload
- upload:/usr/src/app/upload
file:
services:
app:
@ -50,7 +50,7 @@ immich_compose:
cpus: 1.0
mem_limit: 1g
volumes:
- immich_upload:/usr/src/app/upload
- upload:/usr/src/app/upload
restart: always
networks:
default:
@ -96,7 +96,10 @@ immich_compose:
default:
volumes:
immich_upload:
external: true
upload:
driver_opts:
type: cifs
o: "username={{ opentofu.hcloud_storage_box_accounts.immich.user }},password={{ opentofu.hcloud_storage_box_accounts.immich.pass }}"
device: "//{{ opentofu.hcloud_storage_box_accounts.immich.host }}/{{ opentofu.hcloud_storage_box_accounts.immich.user }}"
pgdata:
model-cache:

View file

@ -8,10 +8,5 @@
env: "{{ immich_env }}"
compose: "{{ immich_compose }}"
block:
- name: Import tasks to create docker rclone volume
ansible.builtin.import_tasks: tasks/create-docker-rclone-volume.yml
vars:
task_volume: immich_upload
task_rclone: "{{ opentofu.hcloud_storage_box_accounts.immich }}"
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -47,15 +47,9 @@ immich_worker_compose:
volumes:
upload:
driver: rclone
driver_opts:
type: sftp
sftp_host: "{{ opentofu.hcloud_storage_box_accounts.immich.host }}"
sftp_port: 23
sftp_user: "{{ opentofu.hcloud_storage_box_accounts.immich.user }}"
sftp_pass: "{{ opentofu.hcloud_storage_box_accounts.immich.pass_obscure }}"
allow_other: 'true'
vfs_cache_mode: minimal
poll_interval: 0
type: cifs
o: "username={{ opentofu.hcloud_storage_box_accounts.immich.user }},password={{ opentofu.hcloud_storage_box_accounts.immich.pass }}"
device: "//{{ opentofu.hcloud_storage_box_accounts.immich.host }}/{{ opentofu.hcloud_storage_box_accounts.immich.user }}"
pgdata:
model-cache:

View file

@ -1,29 +0,0 @@
- name: Install fuse system packages
ansible.builtin.apt:
pkg:
- fuse
state: present
update_cache: true
become: true
- name: Create the rclone plugin config dir
ansible.builtin.file:
path: "/var/lib/docker-plugins/rclone/config"
state: directory
mode: "0755"
become: true
- name: Create the rclone plugin cache dir
ansible.builtin.file:
path: "/var/lib/docker-plugins/rclone/cache"
state: directory
mode: "0755"
become: true
- name: Install rclone plugin
community.docker.docker_plugin:
alias: rclone
plugin_name: rclone/docker-volume-rclone:amd64
plugin_options:
args: "-v"
state: enable

View file

@ -3,7 +3,6 @@
pkg:
- bzip2
- jq
- rclone
- zsh
state: present
update_cache: true
@ -11,8 +10,6 @@
- name: Install docker
ansible.builtin.import_tasks: docker.yml
- name: Install docker rclone plugin
ansible.builtin.import_tasks: docker-rclone-plugin.yml
- name: Install (auto-)restic
ansible.builtin.import_tasks: restic.yml
- name: Install systemd-resolved