From 7976630ad7e5006fed2aef63e96284358cc32e22 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 20 Nov 2021 18:29:31 -0600 Subject: [PATCH] Add a box for Syncthing --- playbooks/home_app.yml | 24 ++++++++++++++++++++++++ playbooks/tasks/app/syncthing.yml | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 playbooks/tasks/app/syncthing.yml diff --git a/playbooks/home_app.yml b/playbooks/home_app.yml index c3561b6..fa77b4e 100755 --- a/playbooks/home_app.yml +++ b/playbooks/home_app.yml @@ -20,3 +20,27 @@ backup_s3backup_list_extra: - /data tags: [ backup ] +- hosts: vm-syncthing-1.home.mgmt.desu.ltd + module_defaults: + docker_container: + state: started + restart_policy: unless-stopped + pull: yes + tasks: + - name: assure nfs mount directory + file: path=/data/syncthing/data state=directory mode=0755 + tags: [ storage ] + - name: assure nfs mount + mount: path=/data/syncthing/data src=vm-fs-1.home.mgmt.desu.ltd:/nfs/syncthing fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted + tags: [ storage ] + - name: include tasks for applications + include_tasks: tasks/{{ item }} + with_items: + - app/syncthing.yml + tags: [ always ] + roles: + - role: backup + vars: + backup_s3backup_list_extra: + - /data/syncthing/config + tags: [ backup ] diff --git a/playbooks/tasks/app/syncthing.yml b/playbooks/tasks/app/syncthing.yml new file mode 100644 index 0000000..c6da4a2 --- /dev/null +++ b/playbooks/tasks/app/syncthing.yml @@ -0,0 +1,18 @@ +# vim:ft=ansible: +- name: docker deploy syncthing + docker_container: + name: syncthing + image: linuxserver/syncthing:latest + env: + PUID: "1000" + PGID: "1000" + TZ: America/Chicago + volumes: + - /data/syncthing/config:/config + - /data/syncthing/data:/data + ports: + - 8384:8384 + - 22000:22000/tcp + - 22000:22000/udp + - 21027:21027/udp + tags: [ docker, syncthing ]