view sync.py @ 23:67fc0d4b1859

dead code
author drewp@bigasterisk.com
date Tue, 28 Dec 2021 22:10:02 -0800
parents ac4d24d01b68
children a915000bad75
line wrap: on
line source

from pyinfra import host
from pyinfra.facts.server import LinuxDistribution
from pyinfra.operations import apt, systemd

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

    # 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