view sync.py @ 130:168bc1c44e6f

stop telling arm machines to get i386 pkgs
author drewp@bigasterisk.com
date Wed, 21 Dec 2022 13:09:32 -0800
parents 8b8ef9d8f0fd
children ee0384eebee5
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
if host.name in ['dash', 'dot', 'slash', 'plus', 'bang']:
    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