No description
Find a file
2026-04-05 19:45:53 +00:00
defaults initial commit 2026-04-05 19:45:53 +00:00
meta initial commit 2026-04-05 19:45:53 +00:00
tasks initial commit 2026-04-05 19:45:53 +00:00
.gitignore initial commit 2026-04-05 19:45:53 +00:00
README.md initial commit 2026-04-05 19:45:53 +00:00

ansible-roles-syncthing

Task Configuration

- name: Setup syncthing
  hosts: somehost
  become: true
  roles:
    - role: syncthing
      syncthing_sites:
        - name: some-test
          url: somehost.com
          srv: "{{ syncthing_local_address }}:8080"
    - role: firewalld
      firewalld_services:
        - http
        - https
      firewalld_forwards:
        - port: 80
          to: 8080
        - port: 443
          to: 8443
        - port: 443
          to: 8443
          proto: udp

Current configuration generates a single dynamic config file, this could be reconfigured to read from a directory

syncthing-static.yml.j2

providers:
  providersThrottleDuration: 2s
  file:
    directory: /etc/syncthing/dynamic
    watch: {{ syncthing_watch }}

Deployment and Removal

Sometimes you need to manually stop the running containers to get a clean run when re-deploying Services must be stopped as the respecitve user or another means to aquire the correct user scope for systemd

systemctl --user stop container-syncthing.service

Deploy

ansible-playbook -i hosts site.yml --tags=firewalld,syncthing --limit=somehost

Remove

ansible-playbook -i hosts site.yml --tags=firewalld,syncthing --extra-vars "container_state=absent firewall_action=remove" --limit=somehost