This repository has been archived on 2023-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
max/roles/syncthing/tasks/main.yml

27 lines
739 B
YAML

- name: Install Syncthing
apt:
name: syncthing
state: latest
update_cache: true
- name: Create syncthing user
user:
name: syncthing
home: /home/syncthing
state: present
- name: Copy Syncthing configuration
template:
src: "{{ role_path }}/templates/config.xml.j2"
dest: /home/syncthing/.config/syncthing/config.xml
- name: Copy Syncthing private key
copy:
src: "{{ role_path }}/files/key.pem"
dest: /home/syncthing/.config/syncthing/key.pem
- name: Copy Syncthing certificate
copy:
src: "{{ role_path }}/files/cert.pem"
dest: /home/syncthing/.config/syncthing/cert.pem
- name: Enable Syncthing service
systemd:
name: syncthing@syncthing
enabled: true
state: restarted