add syncthing to stack

This commit is contained in:
Phil 2024-12-26 18:28:37 -07:00
parent bcb082aa98
commit c986c82aa3
3 changed files with 49 additions and 1 deletions

View File

@ -133,3 +133,7 @@
- name: Install baikal - name: Install baikal
import_tasks: baikal.yml import_tasks: baikal.yml
tags: baikal tags: baikal
- name: Install syncthing
import_tasks: syncthing.yml
tags: syncthing

View File

@ -0,0 +1,19 @@
- name: make syncthing directories
ansible.builtin.file:
path: "{{ item}}"
state: directory
loop:
- /opt/stacks/syncthing
- name: Template out the compose file
ansible.builtin.template:
src: syncthing-compose.yml.j2
dest: /opt/stacks/syncthing/compose.yml
owner: root
mode: 644
- name: deploy syncthing stack
community.docker.docker_compose_v2:
project_src: /opt/stacks/syncthing
files:
- compose.yml

View File

@ -0,0 +1,25 @@
services:
syncthing:
image: syncthing/syncthing
container_name: syncthing
hostname: my-syncthing
environment:
- PUID=1000
- PGID=1000
volumes:
- home:/var/syncthing
ports:
- 100.70.169.99:8384:8384 # Web UI
- 100.70.169.99:22000:22000/tcp # TCP file transfers
- 100.70.169.99:22000:22000/udp # QUIC file transfers
- 100.70.169.99:21027:21027/udp # Receive local discovery broadcasts
restart: unless-stopped
healthcheck:
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
interval: 1m
timeout: 10s
retries: 3
volumes:
home: