Mercurial > code > home > repos > infra
comparison sync.py @ 146:2065998876e4
add host 'ditto'
author | drewp@bigasterisk.com |
---|---|
date | Sat, 11 Mar 2023 12:17:56 -0800 |
parents | ee0384eebee5 |
children | 4f1f39f81bc1 |
comparison
equal
deleted
inserted
replaced
145:ee0384eebee5 | 146:2065998876e4 |
---|---|
1 from pyinfra import host | 1 from pyinfra import host |
2 from pyinfra.operations import apt, systemd | 2 from pyinfra.operations import apt, systemd |
3 | 3 |
4 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd. | 4 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd. |
5 # Configs are in ~/.config/syncthing/ on each box | 5 # Configs are in ~/.config/syncthing/ on each box |
6 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang']: | |
7 apt.packages(packages=['syncthing']) | 6 apt.packages(packages=['syncthing']) |
7 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']: | |
8 | 8 |
9 # now we have /lib/systemd/system/syncthing@.service | 9 # now we have /lib/systemd/system/syncthing@.service |
10 user = 'ari' if host.name == 'dot' else 'drewp' | 10 user = 'ari' if host.name == 'dot' else 'drewp' |
11 systemd.service(service=f'syncthing@{user}', running=True, enabled=True) | 11 systemd.service(service=f'syncthing@{user}', running=True, enabled=True) |
12 | 12 |