Mercurial > code > home > repos > infra
changeset 146:2065998876e4
add host 'ditto'
author | drewp@bigasterisk.com |
---|---|
date | Sat, 11 Mar 2023 12:17:56 -0800 |
parents | ee0384eebee5 |
children | 51a48aeca8ba |
files | home.py inventory.py kube.py net.py package_lists.py packages.py sync.py system.py templates/sources.list.j2 templates/wireguard/wg0.conf.j2 |
diffstat | 10 files changed, 32 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/home.py Sat Mar 11 11:22:48 2023 -0800 +++ b/home.py Sat Mar 11 12:17:56 2023 -0800 @@ -5,6 +5,7 @@ 'dash', 'slash', 'bang', + 'ditto', ]: # maybe bring sync.py in here too
--- a/inventory.py Sat Mar 11 11:22:48 2023 -0800 +++ b/inventory.py Sat Mar 11 12:17:56 2023 -0800 @@ -18,6 +18,9 @@ ('dot', { 'ssh_hostname': 'dot', 'wireguard_address': '10.5.0.30', + }), + ('ditto', { + 'wireguard_address': '10.5.0.7', }) ]
--- a/kube.py Sat Mar 11 11:22:48 2023 -0800 +++ b/kube.py Sat Mar 11 12:17:56 2023 -0800 @@ -9,8 +9,8 @@ server_ip = "10.5.0.1" server_node = 'bang' -nodes = ['plus', 'slash', 'dash'] #, 'frontbed', 'garage'] -admin_from = ['bang', 'slash', 'dash'] +nodes = ['slash', 'dash', 'ditto'] #, 'frontbed', 'garage'] +admin_from = ['bang', 'slash', 'dash', 'ditto'] # https://github.com/k3s-io/k3s/releases # 1.23.6 per https://github.com/cilium/cilium/issues/20331 k3s_version = 'v1.24.3+k3s1'
--- a/net.py Sat Mar 11 11:22:48 2023 -0800 +++ b/net.py Sat Mar 11 12:17:56 2023 -0800 @@ -1,8 +1,7 @@ from pyinfra import host from pyinfra.operations import apt, files, server, ssh, systemd -is_wifi = host.name in ['frontdoor', 'living', 'plus'] -is_wifi_pi = host.name in ['frontdoor'] +is_wifi = host.name in ['living', 'plus'] def cleanup(): @@ -45,9 +44,9 @@ else: server.sysctl(key='net.ipv6.conf.all.disable_ipv6', value=1, persist=True) - if is_wifi_pi: - files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") - ssh.command(host.name, "iw wlan0 set power_save off") + # if is_wifi_pi: + # files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") + # ssh.command(host.name, "iw wlan0 set power_save off") files.directory('/etc/systemd/network') if host.name == 'prime':
--- a/package_lists.py Sat Mar 11 11:22:48 2023 -0800 +++ b/package_lists.py Sat Mar 11 12:17:56 2023 -0800 @@ -76,7 +76,7 @@ 'tcpdump', ] -for_bang = [ +for_bang_ditto = [ 'dnsmasq', 'nfs-common', 'openntpd',
--- a/packages.py Sat Mar 11 11:22:48 2023 -0800 +++ b/packages.py Sat Mar 11 12:17:56 2023 -0800 @@ -61,8 +61,8 @@ apt.packages(packages=package_lists.general, **kw) apt.packages(packages=package_lists.debug, **kw) -if host.name == "bang": - apt.packages(packages=package_lists.for_bang, **kw) +if host.name in ["bang" ,'ditto']: + apt.packages(packages=package_lists.for_bang_ditto, **kw) if host.name == "pipe": apt.packages(packages=package_lists.for_pipe, **kw)
--- a/sync.py Sat Mar 11 11:22:48 2023 -0800 +++ b/sync.py Sat Mar 11 12:17:56 2023 -0800 @@ -3,8 +3,8 @@ # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd. # Configs are in ~/.config/syncthing/ on each box -if host.name in ['dash', 'dot', 'slash', 'plus', 'bang']: apt.packages(packages=['syncthing']) +if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']: # now we have /lib/systemd/system/syncthing@.service user = 'ari' if host.name == 'dot' else 'drewp'
--- a/system.py Sat Mar 11 11:22:48 2023 -0800 +++ b/system.py Sat Mar 11 12:17:56 2023 -0800 @@ -111,7 +111,7 @@ if not is_pi: podman_insecure_registry() -if host.name in ['bang', 'pipe']: +if host.name in ['bang', 'pipe', 'ditto']: no_sleep() if host.name == 'bang':
--- a/templates/sources.list.j2 Sat Mar 11 11:22:48 2023 -0800 +++ b/templates/sources.list.j2 Sat Mar 11 12:17:56 2023 -0800 @@ -35,6 +35,22 @@ deb [signed-by=/etc/apt/trusted.gpg] https://deb.nodesource.com/node_16.x jammy main {% endif %} +{% if host.name in ['ditto'] %} +deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main +deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam +deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main +deb http://us.archive.ubuntu.com/ubuntu kinetic main restricted +deb http://us.archive.ubuntu.com/ubuntu kinetic multiverse +deb http://us.archive.ubuntu.com/ubuntu kinetic universe +deb http://us.archive.ubuntu.com/ubuntu kinetic-backports main restricted universe multiverse +deb http://us.archive.ubuntu.com/ubuntu kinetic-security main restricted +deb http://us.archive.ubuntu.com/ubuntu kinetic-security multiverse +deb http://us.archive.ubuntu.com/ubuntu kinetic-security universe +deb http://us.archive.ubuntu.com/ubuntu kinetic-updates main restricted +deb http://us.archive.ubuntu.com/ubuntu kinetic-updates multiverse +deb http://us.archive.ubuntu.com/ubuntu kinetic-updates universe +{% endif %} + {% if host.name in ['slash'] %} deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam
--- a/templates/wireguard/wg0.conf.j2 Sat Mar 11 11:22:48 2023 -0800 +++ b/templates/wireguard/wg0.conf.j2 Sat Mar 11 12:17:56 2023 -0800 @@ -18,6 +18,7 @@ {{ peer_block('slash', 'dZSvwUPLKPrBWY66o8GNeWCcol6lK5QG80HLtOnCRko=', '10.5.0.6/32') }} {{ peer_block('pipe', 'yI0zt8/+baHjadhiBCX6u8sSkhjoh/Q5cIZkGf1H6S4=', '10.5.0.3/32') }} {{ peer_block('plus', 'tH2og4BbXaH6BrHSBd73Fx1XT0DxR8vjQxjqHFa913A=', '10.5.0.110/32') }} + {{ peer_block('ditto', 'IaOJzsn+KK9SuNzn8lJfaD/dgu4Otp094SK0Xz4i4VA=', '10.5.0.7/32') }} {% elif host.name == 'prime' %} {{ peer_block('bang', 'xDkAqfljmeVj7bB6VslxD/vVwlUh/vLXX5Wo7ZCoTQ4=', '10.5.0.0/24') }} {{ peer_block('drew-note10', 'QMgx4cmuUTfJ7RH4Q46b54tSQl4eISOmdEney17fnE8=', '10.5.0.112/32') }}