comparison net.py @ 223:6583e3bb3000

add vips for mqtt servers. first time success with netplan!
author drewp@bigasterisk.com
date Sat, 02 Sep 2023 00:06:02 -0700
parents ef443257ae9c
children eef9d075b3ca
comparison
equal deleted inserted replaced
222:9dfb0916e850 223:6583e3bb3000
38 'update-alternatives --set iptables /usr/sbin/iptables-legacy', 38 'update-alternatives --set iptables /usr/sbin/iptables-legacy',
39 'update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy', 39 'update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy',
40 ]) 40 ])
41 # needs reboot if this changed 41 # needs reboot if this changed
42 42
43 if host.name in ['slash', 'dash', 'ditto', 'squib']: 43 if host.name in ['slash', 'dash', 'dot', 'squib']:
44 pass # don't break k3s networking! the else-part really breaks it 44 pass # don't break k3s networking! the else-part really breaks it
45 else: 45 else:
46 server.sysctl(key='net.ipv6.conf.all.disable_ipv6', value=1, persist=True) 46 server.sysctl(key='net.ipv6.conf.all.disable_ipv6', value=1, persist=True)
47 47
48 # if is_wifi_pi: 48 # if is_wifi_pi:
76 files.template(src="templates/net/pipe_isp.network.j2", dest="/etc/systemd/network/99-isp.network") 76 files.template(src="templates/net/pipe_isp.network.j2", dest="/etc/systemd/network/99-isp.network")
77 server.sysctl(key='net.ipv4.ip_forward', value=1, persist=True) 77 server.sysctl(key='net.ipv4.ip_forward', value=1, persist=True)
78 files.template(src="templates/net/house_net.service.j2", dest="/etc/systemd/system/house_net.service", out_interface='eth0') 78 files.template(src="templates/net/house_net.service.j2", dest="/etc/systemd/system/house_net.service", out_interface='eth0')
79 systemd.service(service='house_net.service', daemon_reload=True, enabled=True, running=True, restarted=True) 79 systemd.service(service='house_net.service', daemon_reload=True, enabled=True, running=True, restarted=True)
80 80
81 elif host.name == 'ditto':
82 files.template(
83 src="templates/net/ditto-netplan.yaml.j2",
84 dest="/etc/netplan/00-installer-config.yaml",
85 create_remote_dir=True,
86 )
87
81 else: 88 else:
82 cleanup() 89 cleanup()
83 90
84 if is_wifi: 91 if is_wifi:
85 files.put(src="secrets/wpa_supplicant.conf", dest="/etc/wpa_supplicant/wpa_supplicant.conf") 92 files.put(src="secrets/wpa_supplicant.conf", dest="/etc/wpa_supplicant/wpa_supplicant.conf")