Mercurial > code > home > repos > infra
annotate sync.py @ 92:a915000bad75
bang has a local (drewp) syncthing now
author | drewp@bigasterisk.com |
---|---|
date | Fri, 15 Jul 2022 14:27:01 -0700 |
parents | 67fc0d4b1859 |
children | 8b8ef9d8f0fd |
rev | line source |
---|---|
14 | 1 from pyinfra import host |
2 from pyinfra.facts.server import LinuxDistribution | |
3 from pyinfra.operations import apt, systemd | |
4 | |
92
a915000bad75
bang has a local (drewp) syncthing now
drewp@bigasterisk.com
parents:
23
diff
changeset
|
5 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd. |
14 | 6 # Configs are in ~/.config/syncthing/ on each box |
92
a915000bad75
bang has a local (drewp) syncthing now
drewp@bigasterisk.com
parents:
23
diff
changeset
|
7 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang']: |
14 | 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 |