27 lines
739 B
YAML
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
|