14
|
1 from pyinfra import host
|
|
2 from pyinfra.facts.server import LinuxDistribution
|
|
3 from pyinfra.operations import apt, systemd
|
|
4
|
|
5 # bang instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd.
|
|
6 # Configs are in ~/.config/syncthing/ on each box
|
|
7 if host.name in ['dash', 'dot', 'slash', 'plus']:
|
|
8 apt.packages(packages=['syncthing'])
|
|
9
|
|
10 # now we have /lib/systemd/system/syncthing@.service
|
|
11 user = 'ari' if host.name == 'dot' else 'drewp'
|
|
12 systemd.service(service=f'syncthing@{user}', running=True, enabled=True)
|
|
13
|
|
14 # also consider https://github.com/Martchus/syncthingtray tray status viewer on dtops
|