Skip to content

Instantly share code, notes, and snippets.

@carlwgeorge
Created May 8, 2020 01:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlwgeorge/dbe186ce7562843932ebd03ccccd1a6d to your computer and use it in GitHub Desktop.
Save carlwgeorge/dbe186ce7562843932ebd03ccccd1a6d to your computer and use it in GitHub Desktop.
- hosts: all
vars:
user: carl
uid: 1000
become: true
tasks:
- name: install syncthing
package:
name: syncthing
- name: enable linger
command: 'loginctl enable-linger {{ user }}'
- name: enable and start user syncthing
become_user: '{{ user }}'
systemd:
name: syncthing
scope: user
enabled: true
state: started
environment:
XDG_RUNTIME_DIR: '/run/user/{{ uid }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment