changeset 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 9dfb0916e850
children d9e272ce211a
files net.py templates/net/ditto-netplan.yaml.j2
diffstat 2 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net.py	Sat Sep 02 00:05:07 2023 -0700
+++ b/net.py	Sat Sep 02 00:06:02 2023 -0700
@@ -40,7 +40,7 @@
 ])
 # needs reboot if this changed
 
-if host.name in ['slash', 'dash', 'ditto', 'squib']:
+if host.name in ['slash', 'dash', 'dot', 'squib']:
     pass # don't break k3s networking! the else-part really breaks it
 else:
     server.sysctl(key='net.ipv6.conf.all.disable_ipv6', value=1, persist=True)
@@ -78,6 +78,13 @@
         files.template(src="templates/net/house_net.service.j2", dest="/etc/systemd/system/house_net.service", out_interface='eth0')
         systemd.service(service='house_net.service', daemon_reload=True, enabled=True, running=True, restarted=True)
 
+    elif host.name == 'ditto':
+        files.template(
+            src="templates/net/ditto-netplan.yaml.j2",
+            dest="/etc/netplan/00-installer-config.yaml",
+            create_remote_dir=True,
+        )
+
     else:
         cleanup()
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/net/ditto-netplan.yaml.j2	Sat Sep 02 00:06:02 2023 -0700
@@ -0,0 +1,22 @@
+# written by pyinfra
+network:
+  ethernets:
+    eno1:
+      addresses:
+        # name=ditto
+        - 10.2.0.133/16
+        # name=mqtt1 etc
+        - 10.2.0.11/16
+        - 10.2.0.12/16
+        - 10.2.0.13/16
+        - 10.2.0.14/16
+      routes:
+        - to: default
+          via: 10.2.0.3
+      nameservers:
+        addresses: [10.2.0.3]
+    enp5s0:
+      dhcp4: true
+    ens3:
+      dhcp4: true
+  version: 2