syncthing/tasks/main.yml

48 lines
994 B
YAML

---
- name: Download discosrv package
become: yes
become_user: pkg
command:
cmd: yay -G syncthing-discosrv
chdir: /home/pkg/
- name: Build discosrv package
become: yes
become_user: pkg
command:
cmd: makepkg
chdir: /home/pkg/syncthing-discosrv
creates: "/home/pkg/syncthing-discosrv/syncthing-discosrv-*.pkg*"
- name: Find pkg
find:
paths: /home/pkg/syncthing-discosrv
file_type: file
patterns: "syncthing-discosrv*pkg*"
register: srv_pkg
- name: Install discosrv
community.general.pacman:
name: "{{ srv_pkg.files[0].path }}"
state: present
- name: Install custom dir
file:
path: /etc/systemd/system/syncthing-discosrv.service.d
state: directory
- name: Add custom exec line to discosrv
template:
dest: /etc/systemd/system/syncthing-discosrv.service.d/listen.conf
src: listen.conf.j2
mode: 0644
- name: Enable and run discosrv
systemd:
enabled: true
state: started
name: syncthing-discosrv