diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2022-12-17 17:02:56 +0100 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2022-12-17 17:02:56 +0100 |
commit | 431c11bee393c31e3280ff4b92d0f2a1792fc0ad (patch) | |
tree | 2f46c92a98f12f0652d52d1cde9f13b9a11e727f | |
parent | 970a107492c31a43bb77f6f5e0096b41adc2c2f4 (diff) | |
download | rules-431c11bee393c31e3280ff4b92d0f2a1792fc0ad.tar.gz |
feat(roles/_workstation): add syncthing role
-rw-r--r-- | roles/_workstation/syncthing/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/_workstation/syncthing/tasks/main.yml | 21 | ||||
-rw-r--r-- | site.workstation.yml | 3 |
3 files changed, 27 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 }}" diff --git a/site.workstation.yml b/site.workstation.yml index 1664015..a7efba8 100644 --- a/site.workstation.yml +++ b/site.workstation.yml @@ -11,6 +11,7 @@ libvirt_workstation_user: "{{ _workstation_user }}" pipewire_workstation_user: "{{ _workstation_user }}" shell_workstation_user: "{{ _workstation_user }}" + syncthing_workstation_user: "{{ _workstation_user }}" yay_workstation_user: "{{ _workstation_user }}" pre_tasks: @@ -58,6 +59,8 @@ when: ansible_distribution in ["Archlinux"] - role: _workstation/resolv when: ansible_distribution in ["Archlinux"] + - role: _workstation/syncthing + when: ansible_distribution in ["Archlinux"] - role: _workstation/tlp when: |