Mercurial > code > home > repos > infra
changeset 61:b46df76991b6
10.1 cleanups; verbose settings; address updates
author | drewp@bigasterisk.com |
---|---|
date | Sun, 01 May 2022 23:34:01 -0700 |
parents | a949704defd0 |
children | 50100cad1f38 |
files | dns.py inventory.py kube.py tasks.py templates/dnsmasq/dhcp_hosts.j2 templates/dnsmasq/dnsmasq.conf.j2 templates/dnsmasq/hosts.j2 |
diffstat | 7 files changed, 26 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/dns.py Sun May 01 23:31:20 2022 -0700 +++ b/dns.py Sun May 01 23:34:01 2022 -0700 @@ -35,7 +35,7 @@ dhcp_hosts = prepare_dhcp_hosts() - for net_name in ['10.1', '10.2', '10.5']: + for net_name in ['10.2', '10.5']: files.directory(path=f'/opt/dnsmasq/{net_name}') files.template(src='templates/dnsmasq/dnsmasq.conf.j2', dest=f'/opt/dnsmasq/{net_name}/dnsmasq.conf', net=net_name) files.template(src='templates/dnsmasq/hosts.j2', dest=f'/opt/dnsmasq/{net_name}/hosts', net=net_name)
--- a/inventory.py Sun May 01 23:31:20 2022 -0700 +++ b/inventory.py Sun May 01 23:34:01 2022 -0700 @@ -7,20 +7,20 @@ }), # ('dash', { "mac": "b8:97:5a:17:d7:1f", - 'ssh_hostname': '10.1.0.5', - 'addr': '10.1.0.5', + 'ssh_hostname': '10.2.0.77', + 'addr': '10.2.0.77', 'wireguard_address': '10.5.0.5', }), ('slash', { 'mac': 'c8:60:00:98:ec:74', - 'ssh_hostname': '10.1.0.6', - 'addr': '10.1.0.6', + 'ssh_hostname': '10.2.0.127', + 'addr': '10.2.0.127', 'wireguard_address': '10.5.0.6', }), ('dot', { - 'mac': 'd4:85:64:c3:db:56', - 'ssh_hostname': '10.2.0.30', - 'addr': '10.2.0.30', + 'mac': '1c:c1:de:56:e6:70', + 'ssh_hostname': '10.2.0.140', + 'addr': '10.2.0.140', 'wireguard_address': '10.5.0.30', }) ] @@ -43,12 +43,12 @@ remote = [ ('prime', { 'mac': '04:01:09:7f:89:01', - 'ssh_hostname': 'public.bigasterisk.com', + 'ssh_hostname': '162.243.138.136', 'addr': '162.243.138.136', 'wireguard_address': '10.5.0.2', }), - ('plus', { - 'ssh_hostname': '10.2.0.136', - 'wireguard_address': '10.5.0.110', - }), + # ('plus', { + # 'ssh_hostname': '10.2.0.136', + # 'wireguard_address': '10.5.0.110', + # }), ]
--- a/kube.py Sun May 01 23:31:20 2022 -0700 +++ b/kube.py Sun May 01 23:34:01 2022 -0700 @@ -1,3 +1,4 @@ +import tempfile from pyinfra import host from pyinfra.facts.files import FindInFile from pyinfra.facts.server import Arch, LinuxDistribution
--- a/tasks.py Sun May 01 23:31:20 2022 -0700 +++ b/tasks.py Sun May 01 23:34:01 2022 -0700 @@ -1,6 +1,5 @@ from invoke import task - cmd = ''' HOME=/root export HOME @@ -31,13 +30,14 @@ @task def net(ctx): - ctx.run(cmd + 'inventory.py net.py -v', pty=True) + ctx.run(cmd + 'inventory.py net.py', pty=True) @task def dns(ctx): - ctx.run(cmd + 'inventory.py dns.py -v', pty=True) - ctx.run(cmd + 'inventory.py dns_check.py -v', pty=True) + ctx.run(cmd + 'inventory.py dns.py', pty=True) + ctx.run(cmd + 'inventory.py dns_check.py', pty=True) + @task def dns_check(ctx): @@ -55,7 +55,7 @@ @task def kube(ctx): - ctx.run(cmd + 'inventory.py kube.py -vv ', pty=True) + ctx.run(cmd + 'inventory.py kube.py ', pty=True) @task
--- a/templates/dnsmasq/dhcp_hosts.j2 Sun May 01 23:31:20 2022 -0700 +++ b/templates/dnsmasq/dhcp_hosts.j2 Sun May 01 23:34:01 2022 -0700 @@ -1,9 +1,9 @@ this is old; see /my/serv/lanscape/netdevices.n3 -b8:97:5a:17:d7:1f,dash,10.1.0.5,infinite -c8:60:00:98:ec:74,slash,10.1.0.6,infinite -7c:c3:a1:b0:83:03,kelsi-imac,10.1.0.7,infinite -1c:c1:de:56:e6:70,music,10.1.0.8,infinite +b8:97:5a:17:d7:1f,dash,10.2.0.77,infinite +c8:60:00:98:ec:74,slash,10.2.0.138,infinite +7c:c3:a1:b0:83:03,kelsi-imac,10.2.0.7,infinite +1c:c1:de:56:e6:70,music,10.2.0.8,infinite a0:40:a0:6f:96:d5,orbi,10.2.0.5,infinite a0:40:a0:6f:aa:f8,orbi-sat1,10.2.0.6,infinite
--- a/templates/dnsmasq/dnsmasq.conf.j2 Sun May 01 23:31:20 2022 -0700 +++ b/templates/dnsmasq/dnsmasq.conf.j2 Sun May 01 23:34:01 2022 -0700 @@ -27,17 +27,6 @@ log-dhcp dhcp-sequential-ip -{% if net == "10.1" %} -dhcp-broadcast -dhcp-authoritative -dhcp-option=option:domain-name,bigasterisk.com -dhcp-hostsfile=/opt/dnsmasq/{{ net }}/dhcp_hosts -dhcp-leasefile=/opt/dnsmasq/{{ net }}/leases -dhcp-range=enp1s0,10.1.0.0,static,infinite -dhcp-range=tag:!known,enp1s0,10.1.0.100,10.1.0.180 -dhcp-option=enp1s0,option:dns-server,10.1.0.1 -dhcp-option=enp1s0,option:router,10.1.0.1 -{% endif %} {% if net == "10.2" %} dhcp-broadcast
--- a/templates/dnsmasq/hosts.j2 Sun May 01 23:31:20 2022 -0700 +++ b/templates/dnsmasq/hosts.j2 Sun May 01 23:34:01 2022 -0700 @@ -20,15 +20,15 @@ {% if net != '10.5' %} # so bang can see these names -10.1.0.5 dash.bigasterisk.com -10.1.0.6 slash.bigasterisk.com +10.2.0.77 dash.bigasterisk.com +10.2.0.138 slash.bigasterisk.com {% endif %} {% if net == '10.5' %} 10.5.0.1 bang.bigasterisk.com 10.5.0.2 prime.bigasterisk.com 10.5.0.5 dash.bigasterisk.com -10.1.0.6 slash.bigasterisk.com +10.5.0.6 slash.bigasterisk.com 10.5.0.14 garage.bigasterisk.com 10.5.0.17 frontbed.bigasterisk.com 10.5.0.30 dot.bigasterisk.com