From 32c090eed77b118a796df887f97a6b17ba725182 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 14 Jun 2023 11:27:44 +0200 Subject: [PATCH] migrate freshrss and radicale to nfs --- ansible/inventory/group_vars/all.yml | 8 +++++- ansible/roles/freshrss/docker-stack.yml.j2 | 29 +++++++++++++++------ ansible/roles/nextcloud/docker-stack.yml.j2 | 2 +- ansible/roles/radicale/docker-stack.yml.j2 | 18 ++++++++----- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/ansible/inventory/group_vars/all.yml b/ansible/inventory/group_vars/all.yml index 7ea375a..8bdef52 100644 --- a/ansible/inventory/group_vars/all.yml +++ b/ansible/inventory/group_vars/all.yml @@ -3,7 +3,13 @@ git_ssh_port: 56287 nfs_shares: - name: nextcloud_data - path: "/mnt/data/nextcloud/data" + path: /mnt/data/nextcloud/data + - name: radicale + path: /mnt/data/radicale + - name: freshrss_data + path: /mnt/data/freshrss/data + - name: freshrss_extensions + path: /mnt/data/freshrss/extensions database_passwords: nextcloud: !vault | diff --git a/ansible/roles/freshrss/docker-stack.yml.j2 b/ansible/roles/freshrss/docker-stack.yml.j2 index 43cbd85..2a23a77 100644 --- a/ansible/roles/freshrss/docker-stack.yml.j2 +++ b/ansible/roles/freshrss/docker-stack.yml.j2 @@ -5,18 +5,34 @@ networks: traefik: external: true +volumes: + data: + driver_opts: + type: "nfs" + o: "addr=192.168.30.10,nolock,soft,rw" + device: ":/mnt/data/freshrss/data" + extensions: + driver_opts: + type: "nfs" + o: "addr=192.168.30.10,nolock,soft,rw" + device: ":/mnt/data/freshrss/extensions" + services: freshrss: image: freshrss/freshrss:edge networks: - traefik volumes: - - type: bind - source: /mnt/data/freshrss/data + - type: volume + source: data target: /var/www/FreshRSS/data - - type: bind - source: /mnt/data/freshrss/extensions + volume: + nocopy: true + - type: volume + source: extensions target: /var/www/FreshRSS/extensions + volume: + nocopy: true environment: TZ: Europe/Amsterdam CRON_MIN: '2,32' @@ -25,13 +41,10 @@ services: ADMIN_API_PASSWORD: {{ admin_password }} PUBLISHED_PORT: 443 deploy: - placement: - constraints: - - "node.labels.freshrss == true" labels: - traefik.enable=true - traefik.http.routers.freshrss.entrypoints=websecure - - traefik.http.routers.freshrss.rule=Host(`rss.pim.kunis.nl`) + - traefik.http.routers.freshrss.rule=Host(`rss.kun.is`) - traefik.http.routers.freshrss.tls=true - traefik.http.routers.freshrss.tls.certresolver=letsencrypt - traefik.http.routers.freshrss.service=freshrss diff --git a/ansible/roles/nextcloud/docker-stack.yml.j2 b/ansible/roles/nextcloud/docker-stack.yml.j2 index 4d535f4..395556c 100644 --- a/ansible/roles/nextcloud/docker-stack.yml.j2 +++ b/ansible/roles/nextcloud/docker-stack.yml.j2 @@ -32,7 +32,7 @@ services: labels: - traefik.enable=true - traefik.http.routers.nextcloud.entrypoints=websecure - - traefik.http.routers.nextcloud.rule=Host(`cloud.pim.kunis.nl`) + - traefik.http.routers.nextcloud.rule=Host(`cloud.kun.is`) - traefik.http.routers.nextcloud.tls=true - traefik.http.routers.nextcloud.tls.certresolver=letsencrypt - traefik.http.routers.nextcloud.service=nextcloud diff --git a/ansible/roles/radicale/docker-stack.yml.j2 b/ansible/roles/radicale/docker-stack.yml.j2 index 794e52d..61fba13 100644 --- a/ansible/roles/radicale/docker-stack.yml.j2 +++ b/ansible/roles/radicale/docker-stack.yml.j2 @@ -13,6 +13,13 @@ configs: external: true name: "{{ users.config_name }}" +volumes: + data: + driver_opts: + type: "nfs" + o: "addr=192.168.30.10,nolock,soft,rw" + device: ":/mnt/data/radicale" + services: radicale: image: tomsquest/docker-radicale @@ -30,19 +37,18 @@ services: interval: 30s retries: 3 volumes: - - type: bind - source: /mnt/data/radicale + - type: volume + source: data target: /data + volume: + nocopy: true networks: - traefik deploy: - placement: - constraints: - - "node.labels.radicale == true" labels: - traefik.enable=true - traefik.http.routers.radicale.entrypoints=websecure - - traefik.http.routers.radicale.rule=Host(`dav.pim.kunis.nl`) + - traefik.http.routers.radicale.rule=Host(`dav.kun.is`) - traefik.http.routers.radicale.tls=true - traefik.http.routers.radicale.tls.certresolver=letsencrypt - traefik.http.routers.radicale.service=radicale