Mercurial > code > home > repos > infra
annotate tasks.py @ 1:b664f1027992
system.py port from ansible
author | drewp@bigasterisk.com |
---|---|
date | Thu, 04 Nov 2021 18:10:02 -0700 |
parents | 1550a6db59b3 |
children | 61945df2a392 |
rev | line source |
---|---|
0
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
1 from invoke import task |
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
2 |
1 | 3 cmd = ''' |
0
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
4 HOME=/root |
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
5 export HOME |
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
6 eval `keychain --quiet --eval id_ecdsa` |
1550a6db59b3
first ported section from ansible. shorter, faster, clearer.
drewp@bigasterisk.com
parents:
diff
changeset
|
7 cd /my/proj/infra |
1 | 8 env/bin/pyinfra inventory.py ''' |
9 | |
10 @task | |
11 def users(ctx): | |
12 ctx.run(cmd + 'users.py', pty=True) | |
13 | |
14 @task | |
15 def system(ctx): | |
16 ctx.run(cmd + 'system.py', pty=True) |