diff --git a/host_vars/fudiggity/syncthing.yml b/host_vars/fudiggity/syncthing.yml
index 8ca4cf8..0721455 100644
--- a/host_vars/fudiggity/syncthing.yml
+++ b/host_vars/fudiggity/syncthing.yml
@@ -1,14 +1,7 @@
---
syncthing_app_dir: "/srv/docker/syncthing"
-syncthing_config_version: 37
-syncthing_api_key: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 31663863326431623139663861316432656264646533323934393033386263613162303266613265
- 3239613930623264383161363664636232663764616138360a643239393735393862376133313062
- 63643434636462306663303434393837353230623830323065626432346336363332363063313533
- 6334633838636664610a323762373839393331653130393136356136303535393662643736643735
- 30316565373866326337383137633639636566623263333061633830366634666537633765343533
- 3736383135393238663963353131663733363962343163363539
+syncthing_image_tag: "syncthing/syncthing:2.0"
+syncthing_config_version: 51
syncthing_devices:
- name: Desktop
diff --git a/tasks/syncthing.yml b/tasks/syncthing.yml
index e4649d3..71b2668 100644
--- a/tasks/syncthing.yml
+++ b/tasks/syncthing.yml
@@ -25,6 +25,11 @@
owner: sonny
group: sonny
+- name: Stop current containers
+ community.docker.docker_compose_v2:
+ project_src: "{{ syncthing_app_dir }}"
+ state: stopped
+
- name: Remove previous Syncthing configurations
become: true
ansible.builtin.file:
@@ -40,6 +45,11 @@
group: sonny
mode: "0755"
+# The current configuration has the bare minimum options configured per element
+# and relies on falling back to syncthing's defaults. This is because Syncthing
+# overwrites the config file while the application is running,
+# see https://forum.syncthing.net/t/manage-devices-and-folders-with-ansible/20078.
+# Note that the config version should also be updated whenever the image tag is updated.
- name: Copy Syncthing configuration
become: true
ansible.builtin.template:
@@ -58,17 +68,6 @@
group: sonny
mode: "0755"
-- name: Stop current containers
- community.docker.docker_compose_v2:
- project_src: "{{ syncthing_app_dir }}"
- state: stopped
-
-- name: Pull missing image
- community.docker.docker_compose_v2:
- project_src: "{{ syncthing_app_dir }}"
- pull: missing
- state: stopped
-
- name: Remove dangling containers
community.docker.docker_compose_v2:
project_src: "{{ syncthing_app_dir }}"
diff --git a/templates/syncthing/config.j2 b/templates/syncthing/config.j2
index c48c0d8..372a48a 100644
--- a/templates/syncthing/config.j2
+++ b/templates/syncthing/config.j2
@@ -14,39 +14,7 @@
{%- endfor %}
-