view tasks.py @ 3:61945df2a392

updates to work on recent raspbian installs
author drewp@bigasterisk.com
date Sun, 07 Nov 2021 15:42:37 -0800
parents b664f1027992
children 7e8c7de5b490
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 get_fact(ctx, host='dash', fact='server.LinuxDistribution'):
    ctx.run(cmd + f'{host} fact {fact}', pty=True)