mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
add syncthing support
This commit is contained in:
parent
e41c373e19
commit
d8d5a799c0
3 changed files with 35 additions and 0 deletions
|
|
@ -242,3 +242,6 @@ aur_fonts:
|
|||
- ttf-caladea
|
||||
- ttf-courier-prime
|
||||
- ttf-heuristica
|
||||
|
||||
syncthing:
|
||||
run_on: trusted
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
- { role: hostsctl, tags: ['hostsctl'], when: "hostsctl is defined" }
|
||||
- { role: himawaripy, tags: ['himawaripy'], when: "himawaripy is defined" }
|
||||
- { role: kiwix, tags: ['kiwix'] }
|
||||
- { role: syncthing, tags: ['syncthing'], when: "syncthing is defined" }
|
||||
vars_prompt:
|
||||
- name: user_password
|
||||
prompt: "Enter desired user password"
|
||||
|
|
|
|||
31
roles/syncthing/tasks/main.yml
Normal file
31
roles/syncthing/tasks/main.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- name: Install syncthing
|
||||
pacman: name=syncthing state=present
|
||||
|
||||
- name: Enable and start syncthing service
|
||||
systemd: name=syncthing.service user=yes enabled=yes state=started
|
||||
become: yes
|
||||
become_user: "{{ user.name }}"
|
||||
environment:
|
||||
XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"
|
||||
when: syncthing.run_on == "all"
|
||||
|
||||
- name: Remove syncthing from trusted unit list
|
||||
lineinfile: dest=/usr/local/etc/trusted_units
|
||||
state=absent
|
||||
line="syncthing.service,user:{{ user.name }}"
|
||||
when: syncthing.run_on == "all"
|
||||
|
||||
- name: Disable syncthing service
|
||||
systemd: name=syncthing.service user=yes enabled=no
|
||||
become: yes
|
||||
become_user: "{{ user.name }}"
|
||||
environment:
|
||||
XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"
|
||||
when: syncthing.run_on == "trusted"
|
||||
|
||||
- name: Add syncthing to trusted unit list
|
||||
lineinfile: dest=/usr/local/etc/trusted_units
|
||||
state=present
|
||||
line="syncthing.service,user:{{ user.name }}"
|
||||
when: syncthing.run_on == "trusted"
|
||||
Loading…
Add table
Add a link
Reference in a new issue