Add remote docker volumes (using rclone)

This commit is contained in:
Tobias Reisinger 2024-10-30 03:52:16 +01:00
parent f20b2596d0
commit a2c680f3e8
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
6 changed files with 39 additions and 5 deletions

View file

@ -22,6 +22,9 @@ class FilterModule(object):
if location["type"] == "docker":
new_location["from"] = name
new_location["type"] = "volume"
if location["type"] == "docker_remote":
new_location["from"] = name
new_location["type"] = "volume"
if location["type"] == "hook":
backup_dir = f"/opt/services/_backup/{name}"

View file

@ -68,6 +68,6 @@ immich_compose:
default:
volumes:
upload:
upload: "{{ vault_immich.upload_volume_driver }}"
pgdata:
model-cache:

View file

@ -23,4 +23,4 @@ jellyfin_compose:
volumes:
config:
cache:
media:
media: "{{ vault_jellyfin.media_volume_driver }}"

View file

@ -0,0 +1,29 @@
- 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

@ -7,6 +7,8 @@
- name: Install docker
ansible.builtin.import_tasks: docker.yml
- name: Install docker rclone plugin
ansible.builtin.import_tasks: docker-rclone-plugin.yml
- name: Install jq and bzip2
ansible.builtin.apt:

View file

@ -184,7 +184,7 @@ services = {
backup = [
{
name = "immich_upload"
type = "docker"
type = "docker_remote"
},
{
name = "immich_database"
@ -223,7 +223,7 @@ services = {
},
"jellyfin" = {
host = "node002"
host = "node001"
dns = [{
domain = "media.serguzim.me"
}]
@ -234,7 +234,7 @@ services = {
},
{
name = "jellyfin_media"
type = "docker"
type = "docker_remote"
}
]
monitoring = {