annotate sync.py @ 146:2065998876e4

add host 'ditto'
author drewp@bigasterisk.com
date Sat, 11 Mar 2023 12:17:56 -0800
parents ee0384eebee5
children 4f1f39f81bc1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
1 from pyinfra import host
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
2 from pyinfra.operations import apt, systemd
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
3
92
a915000bad75 bang has a local (drewp) syncthing now
drewp@bigasterisk.com
parents: 23
diff changeset
4 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd.
14
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
5 # Configs are in ~/.config/syncthing/ on each box
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
6 apt.packages(packages=['syncthing'])
146
2065998876e4 add host 'ditto'
drewp@bigasterisk.com
parents: 145
diff changeset
7 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']:
14
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
8
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
9 # now we have /lib/systemd/system/syncthing@.service
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
10 user = 'ari' if host.name == 'dot' else 'drewp'
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
11 systemd.service(service=f'syncthing@{user}', running=True, enabled=True)
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
12
ac4d24d01b68 add syncthing service
drewp@bigasterisk.com
parents:
diff changeset
13 # also consider https://github.com/Martchus/syncthingtray tray status viewer on dtops
145
drewp@bigasterisk.com
parents: 103
diff changeset
14
drewp@bigasterisk.com
parents: 103
diff changeset
15 # also consider https://github.com/Martchus/syncthingtray tray status viewer on dtops