aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/_workstation/syncthing/defaults/main.yml3
-rw-r--r--roles/_workstation/syncthing/tasks/main.yml21
2 files changed, 24 insertions, 0 deletions
diff --git a/roles/_workstation/syncthing/defaults/main.yml b/roles/_workstation/syncthing/defaults/main.yml
new file mode 100644
index 0000000..5546e71
--- /dev/null
+++ b/roles/_workstation/syncthing/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+
+syncthing_workstation_user: null
diff --git a/roles/_workstation/syncthing/tasks/main.yml b/roles/_workstation/syncthing/tasks/main.yml
new file mode 100644
index 0000000..45a97a2
--- /dev/null
+++ b/roles/_workstation/syncthing/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+
+- name: install syncthing
+ ansible.builtin.package:
+ name: syncthing
+ state: present
+
+- name: get syncthing user id
+ ansible.builtin.getent:
+ database: passwd
+
+- name: enable and start syncthing
+ ansible.builtin.systemd:
+ name: syncthing
+ state: started
+ enabled: true
+ scope: user
+ environment:
+ XDG_RUNTIME_DIR: "/run/user/{{ ansible_facts.getent_passwd[syncthing_workstation_user][1] }}"
+ become: true
+ become_user: "{{ dotfiles_workstation_user }}"
remember that computers suck.