Mercurial > code > home > repos > infra
comparison tasks.py @ 205:826db3c40fa7
whitespace/etc
author | drewp@bigasterisk.com |
---|---|
date | Fri, 07 Jul 2023 16:11:41 -0700 |
parents | a5399e8b47b6 |
children | 117cd86ffb53 |
comparison
equal
deleted
inserted
replaced
204:ad6e997fd323 | 205:826db3c40fa7 |
---|---|
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 pdm run pyinfra ''' | 8 pdm run pyinfra ''' |
9 | 9 |
10 | |
10 def _run(ctx, s): | 11 def _run(ctx, s): |
11 ctx.run(cmd + 'inventory.py %s' % s, pty=True, echo=True) | 12 ctx.run(cmd + 'inventory.py %s' % s, pty=True, echo=True) |
12 | 13 |
13 | 14 |
14 @task | 15 @task |
15 def users(ctx): _run(ctx, 'users.py') | 16 def users(ctx): |
17 _run(ctx, 'users.py') | |
18 | |
16 | 19 |
17 @task | 20 @task |
18 def ssh(ctx): _run(ctx, 'ssh.py') | 21 def ssh(ctx): |
22 _run(ctx, 'ssh.py') | |
23 | |
19 | 24 |
20 @task | 25 @task |
21 def system(ctx): _run(ctx, 'system.py') | 26 def system(ctx): |
27 _run(ctx, 'system.py') | |
28 | |
22 | 29 |
23 @task | 30 @task |
24 def apt(ctx): _run(ctx, 'apt.py') | 31 def apt(ctx): |
32 _run(ctx, 'apt.py') | |
33 | |
25 | 34 |
26 @task | 35 @task |
27 def packages(ctx): _run(ctx, 'packages.py') | 36 def packages(ctx): |
37 _run(ctx, 'packages.py') | |
38 | |
28 | 39 |
29 @task | 40 @task |
30 def net(ctx): _run(ctx, 'net.py') | 41 def net(ctx): |
42 _run(ctx, 'net.py') | |
43 | |
31 | 44 |
32 @task | 45 @task |
33 def dns(ctx): _run(ctx, 'dns.py') | 46 def dns(ctx): |
47 _run(ctx, 'dns.py') | |
48 | |
34 | 49 |
35 @task | 50 @task |
36 def dns_check(ctx): _run(ctx, 'dns_check.py -v') | 51 def dns_check(ctx): |
52 _run(ctx, 'dns_check.py -v') | |
53 | |
37 | 54 |
38 @task | 55 @task |
39 def dns_k8s_check(ctx): ctx.run('env/bin/python dns_k8s_check.py', pty=True) | 56 def dns_k8s_check(ctx): |
57 ctx.run('env/bin/python dns_k8s_check.py', pty=True) | |
58 | |
40 | 59 |
41 @task | 60 @task |
42 def wireguard(ctx): _run(ctx, 'wireguard.py') | 61 def wireguard(ctx): |
62 _run(ctx, 'wireguard.py') | |
63 | |
43 | 64 |
44 @task | 65 @task |
45 def kube(ctx): _run(ctx, 'kube.py') | 66 def kube(ctx): |
67 _run(ctx, 'kube.py') | |
68 | |
46 | 69 |
47 @task | 70 @task |
48 def kube_bang(ctx): _run(ctx, 'kube.py --limit bang') | 71 def kube_bang(ctx): |
72 _run(ctx, 'kube.py --limit bang') | |
73 | |
49 | 74 |
50 @task | 75 @task |
51 def sync(ctx): _run(ctx, 'sync.py') | 76 def sync(ctx): |
77 _run(ctx, 'sync.py') | |
78 | |
52 | 79 |
53 @task | 80 @task |
54 def mail(ctx): _run(ctx, 'mail.py') | 81 def mail(ctx): |
82 _run(ctx, 'mail.py') | |
83 | |
55 | 84 |
56 @task | 85 @task |
57 def home(ctx): _run(ctx, 'home.py') | 86 def home(ctx): |
87 _run(ctx, 'home.py') | |
88 | |
58 | 89 |
59 @task | 90 @task |
60 def pipe(ctx): ctx.run(cmd + 'inventory.py pipe.py --limit pipe', pty=True) | 91 def pipe(ctx): |
92 ctx.run(cmd + 'inventory.py pipe.py --limit pipe', pty=True) | |
93 | |
61 | 94 |
62 @task | 95 @task |
63 def multikube(ctx): # danger- wipes previous k3s | 96 def multikube(ctx): # danger- wipes previous k3s |
64 from multikube_config import server_node, nodes | 97 from multikube_config import server_node, nodes |
65 ctx.run(cmd + 'inventory.py multikube_wipe.py', pty=True) | 98 ctx.run(cmd + 'inventory.py multikube_wipe.py', pty=True) |
66 ctx.run(cmd + f'inventory.py multikube.py --limit {server_node}', pty=True) | 99 ctx.run(cmd + f'inventory.py multikube.py --limit {server_node}', pty=True) |
67 if nodes: | 100 if nodes: |
68 ctx.run(cmd + f'inventory.py multikube.py {" ".join(f"--limit {n}" for n in nodes)}', pty=True) | 101 ctx.run(cmd + f'inventory.py multikube.py {" ".join(f"--limit {n}" for n in nodes)}', pty=True) |