From 12f33d9ffcc6dd6046be832ba37c8bfef891dc06 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 24 Nov 2021 10:43:29 -0600 Subject: [PATCH] Put Syncthing behind an ingress container --- playbooks/home_app.yml | 17 +++++++++++++++++ playbooks/tasks/app/syncthing.yml | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/playbooks/home_app.yml b/playbooks/home_app.yml index fa77b4e..3d0cf86 100755 --- a/playbooks/home_app.yml +++ b/playbooks/home_app.yml @@ -26,6 +26,10 @@ state: started restart_policy: unless-stopped pull: yes + pre_tasks: + - name: ensure docker network + docker_network: name=web + tags: [ docker ] tasks: - name: assure nfs mount directory file: path=/data/syncthing/data state=directory mode=0755 @@ -44,3 +48,16 @@ backup_s3backup_list_extra: - /data/syncthing/config tags: [ backup ] + - role: ingress + vars: + ingress_container_image: "nginx:latest" + ingress_container_ports: + - 80:80 + ingress_container_config_mount: /etc/nginx/conf.d + ingress_container_persist_dir: /data/nginx + ingress_listen_args: 80 + ingress_listen_tls: no + ingress_servers: + - name: syncthing.local.desu.ltd + proxy_pass: http://syncthing:8384 + tags: [ ingress ] diff --git a/playbooks/tasks/app/syncthing.yml b/playbooks/tasks/app/syncthing.yml index c6da4a2..1f40f2a 100644 --- a/playbooks/tasks/app/syncthing.yml +++ b/playbooks/tasks/app/syncthing.yml @@ -7,11 +7,13 @@ PUID: "1000" PGID: "1000" TZ: America/Chicago + networks: + - name: web + aliases: [ "syncthing" ] volumes: - /data/syncthing/config:/config - /data/syncthing/data:/data ports: - - 8384:8384 - 22000:22000/tcp - 22000:22000/udp - 21027:21027/udp