view sync.py @ 146:2065998876e4

add host 'ditto'
author drewp@bigasterisk.com
date Sat, 11 Mar 2023 12:17:56 -0800
parents ee0384eebee5
children 4f1f39f81bc1
line wrap: on
line source

from pyinfra import host
from pyinfra.operations import apt, systemd

# primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd.
# Configs are in ~/.config/syncthing/ on each box
    apt.packages(packages=['syncthing'])
if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']:

    # now we have /lib/systemd/system/syncthing@.service
    user = 'ari' if host.name == 'dot' else 'drewp'
    systemd.service(service=f'syncthing@{user}', running=True, enabled=True)

    # also consider https://github.com/Martchus/syncthingtray tray status viewer on dtops

# also consider https://github.com/Martchus/syncthingtray tray status viewer on dtops