- name: Install Syncthing
become: true
apt:
name: syncthing
- name: Create Syncthing configuration directory
file:
path: ~/.config/syncthing
state: directory
- name: Copy Syncthing configuration
template:
src: "{{ role_path }}/templates/config.xml.j2"
dest: ~/.config/syncthing/config.xml
- name: Copy Syncthing private key
copy:
src: "{{ role_path }}/files/key.pem"
dest: ~/.config/syncthing/key.pem
- name: Copy Syncthing certificate
src: "{{ role_path }}/files/cert.pem"
dest: ~/.config/syncthing/cert.pem
- name: Enable Syncthing
systemd:
enabled: true
name: "syncthing@{{ ansible_user_id }}"
state: restarted