123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- ---
- - name: Fetched syncthing release
- shell:
- chdir: /tmp
- cmd: fetch https://github.com/syncthing/syncthing/releases/download/v1.21.0/syncthing-freebsd-amd64-v1.21.0.tar.gz
- - name: Unpacked syncthing release
- shell:
- chdir: /tmp
- cmd: tar zxf syncthing-freebsd-amd64-v1.21.0.tar.gz
- - name: Syncthing installed
- shell:
- chdir: /tmp/syncthing-freebsd-amd64-v1.21.0
- cmd: "cp syncthing /usr/local/bin/syncthing & cp etc/freebsd-rc/syncthing /usr/local/etc/rc.d/syncthing & chmod +x /usr/local/etc/rc.d/syncthing"
- warn: false
- - name: Syncthing enabled
- shell: sysrc syncthing_enable="YES"
- - name: Syncthing group set to wheel
- shell: sysrc syncthing_group="wheel"
- - name: Syncthing user set to root
- shell: sysrc syncthing_group="root"
- - name: Ensure syncthing is running
- service: name=syncthing state=started
- - name: Syncthing enabled on all interfaces
- shell:
- cmd: "sed -i -e '/^ <address>127.0.0.1:8384/s/127.0.0.1/0.0.0.0/' /usr/local/etc/syncthing/config.xml"
- warn: false
- notify: Syncthing restarted
- - name: Syncthing TLS enabled
- shell:
- cmd: 'sed -i -e ''/^ <gui/s/tls="false"/tls="true"/'' /usr/local/etc/syncthing/config.xml'
- warn: false
- notify: Syncthing restarted
- - name: Syncthing password protected user
- ansible.builtin.lineinfile:
- path: /usr/local/etc/syncthing/config.xml
- insertafter: "^ <address>0.0.0.0:8384</address>"
- line: " <user>admin</user>"
- notify: Syncthing restarted
- - name: Syncthing password protected pass
- ansible.builtin.lineinfile:
- path: /usr/local/etc/syncthing/config.xml
- insertafter: "^ <address>0.0.0.0:8384</address>"
- line: " <password>{{ syncthing_admin_pass }}</password>"
- notify: Syncthing restarted
- - name: Syncthing disable fsWatcher
- shell:
- cmd: 'sed -i -e ''s/fsWatcherEnabled="true"/fsWatcherEnabled="false"/'' /usr/local/etc/syncthing/config.xml'
- warn: false
- notify: Syncthing restarted
- - name: Ensure syncthing is restarted
- service: name=syncthing state=restarted
|