comparison 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
comparison
equal deleted inserted replaced
2:7f7af7e2ba8d 3:61945df2a392
3 cmd = ''' 3 cmd = '''
4 HOME=/root 4 HOME=/root
5 export HOME 5 export HOME
6 eval `keychain --quiet --eval id_ecdsa` 6 eval `keychain --quiet --eval id_ecdsa`
7 cd /my/proj/infra 7 cd /my/proj/infra
8 env/bin/pyinfra inventory.py ''' 8 env/bin/pyinfra '''
9 9
10 @task 10 @task
11 def users(ctx): 11 def users(ctx):
12 ctx.run(cmd + 'users.py', pty=True) 12 ctx.run(cmd + 'inventory.py users.py', pty=True)
13 13
14 @task 14 @task
15 def system(ctx): 15 def system(ctx):
16 ctx.run(cmd + 'system.py', pty=True) 16 ctx.run(cmd + 'inventory.py system.py', pty=True)
17
18 @task
19 def get_fact(ctx, host='dash', fact='server.LinuxDistribution'):
20 ctx.run(cmd + f'{host} fact {fact}', pty=True)