feat: add Syncthing service deployment and configuration
This commit is contained in:
parent
9c3f54e760
commit
b5447dc0ec
@ -33,3 +33,5 @@
|
||||
enabled: true
|
||||
- name: uptime-kuma
|
||||
enabled: true
|
||||
- name: syncthing
|
||||
enabled: true
|
||||
|
@ -0,0 +1,28 @@
|
||||
services:
|
||||
syncthing:
|
||||
image: syncthing/syncthing
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=100
|
||||
- TZ=Europe/Amsterdam
|
||||
# Disable local discovery since server is not on local network
|
||||
- STTRACE=
|
||||
- STNODEFAULTFOLDER=true
|
||||
- STNODEFAULTFOLDERROOT=true
|
||||
- STNOUPGRADE=true
|
||||
# Disable local discovery
|
||||
- STGUIADDRESS=0.0.0.0:8384not on local network
|
||||
- STLOCALANNOUNCEENABLED=false
|
||||
- STGLOBALDISCOVERYENABLED=true
|
||||
volumes:
|
||||
- {{ syncthing_data_dir }}:/var/syncthing
|
||||
ports:
|
||||
- 8384:8384 # Web UI
|
||||
- 22000:22000/tcp # TCP file transfers
|
||||
- 22000:22000/udp # QUIC file transfers
|
||||
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
|
@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Deploy Syncthing service
|
||||
block:
|
||||
- name: Set Syncthing directories
|
||||
ansible.builtin.set_fact:
|
||||
syncthing_service_dir: "{{ ansible_env.HOME }}/services/syncthing"
|
||||
syncthing_data_dir: "/mnt/object_storage/services/syncthing"
|
||||
|
||||
- name: Create Syncthing directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ syncthing_service_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Deploy Syncthing docker-compose.yml
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ syncthing_service_dir }}/docker-compose.yml"
|
||||
mode: "0644"
|
||||
register: syncthing_compose
|
||||
|
||||
- name: Stop Syncthing service
|
||||
ansible.builtin.command: docker compose -f "{{ syncthing_service_dir }}/docker-compose.yml" down --remove-orphans
|
||||
when: syncthing_compose.changed
|
||||
|
||||
- name: Start Syncthing service
|
||||
ansible.builtin.command: docker compose -f "{{ syncthing_service_dir }}/docker-compose.yml" up -d
|
||||
when: syncthing_compose.changed
|
Loading…
x
Reference in New Issue
Block a user