Mercurial > code > home > repos > infra
comparison tasks.py @ 54:00d5cd21cade
save ran_all.timestamp
author | drewp@bigasterisk.com |
---|---|
date | Wed, 06 Apr 2022 19:19:09 -0700 |
parents | 68eeca50ae7f |
children | fa7a71b8a97f |
comparison
equal
deleted
inserted
replaced
53:8945bf71da22 | 54:00d5cd21cade |
---|---|
1 from invoke import task | 1 from invoke import task |
2 | 2 |
3 '🛁 bang(pts/2):/my/proj/infra% sudo inv users ssh system packages net dns wireguard kube sync mail' | |
4 | 3 |
5 cmd = ''' | 4 cmd = ''' |
6 HOME=/root | 5 HOME=/root |
7 export HOME | 6 export HOME |
8 eval `keychain --quiet --eval id_ecdsa` | 7 eval `keychain --quiet --eval id_ecdsa` |
63 @task | 62 @task |
64 def mail(ctx): | 63 def mail(ctx): |
65 ctx.run(cmd + 'inventory.py mail.py ', pty=True) | 64 ctx.run(cmd + 'inventory.py mail.py ', pty=True) |
66 | 65 |
67 | 66 |
67 @task(pre=[users, ssh, system, packages, net, dns, wireguard, kube, sync, mail]) | |
68 def all(ctx): | |
69 ctx.run('touch /my/proj/infra/ran_all.timestamp') | |
70 | |
71 | |
68 @task | 72 @task |
69 def get_fact(ctx, host='dash', fact='server.LinuxDistribution'): | 73 def get_fact(ctx, host='dash', fact='server.LinuxDistribution'): |
70 ctx.run(cmd + f'{host} -vv fact {fact}', pty=True) | 74 ctx.run(cmd + f'{host} -vv fact {fact}', pty=True) |