view tasks.py @ 6:aa633eb49c63

have pi use bullseye for working netplan.io pkg
author drewp@bigasterisk.com
date Wed, 10 Nov 2021 09:53:49 -0800
parents 7e8c7de5b490
children b6fff51f8676
line wrap: on
line source

from invoke import task

cmd = '''
HOME=/root
export HOME
eval `keychain --quiet --eval id_ecdsa`
cd /my/proj/infra
env/bin/pyinfra '''


@task
def users(ctx):
    ctx.run(cmd + 'inventory.py users.py', pty=True)


@task
def system(ctx):
    ctx.run(cmd + 'inventory.py system.py', pty=True)


@task
def wireguard(ctx):
    ctx.run(cmd + 'inventory.py wireguard.py', pty=True)


@task
def get_fact(ctx, host='dash', fact='server.LinuxDistribution'):
    ctx.run(cmd + f'{host} fact {fact}', pty=True)