diff --git a/systemd/network/yy-pxe.network b/systemd/network/yy-pxe.network index 76792c4..77f2ae2 100644 --- a/systemd/network/yy-pxe.network +++ b/systemd/network/yy-pxe.network @@ -1,15 +1,15 @@ [Match] -Name=* -Type=!loopback bridge tunnel vxlan wireguard -Driver=!veth dummy +# Only virtual NICs have a Kind, and we want to exclude those. +Kind=!?* +Type=!loopback KernelCommandLine=!root [Network] DHCP=yes -KeepConfiguration=dhcp-on-stop +KeepConfiguration=dynamic-on-stop IPv6AcceptRA=true [DHCP] -ClientIdentifier=mac UseMTU=true UseDomains=true +ClientIdentifier=mac diff --git a/systemd/network/yy-vmware.network b/systemd/network/yy-vmware.network index 2d780a1..d37de83 100644 --- a/systemd/network/yy-vmware.network +++ b/systemd/network/yy-vmware.network @@ -1,11 +1,12 @@ [Match] +# Only virtual NICs have a Kind, and we want to exclude those. +Kind=!?* +Type=!loopback Virtualization=vmware -Type=!loopback dummy bridge tunnel vxlan wireguard -Driver=!veth [Network] DHCP=yes -KeepConfiguration=dhcp-on-stop +KeepConfiguration=dynamic-on-stop IPv6AcceptRA=true [DHCP] diff --git a/systemd/network/zz-default.network b/systemd/network/zz-default.network index 451e031..c23604d 100644 --- a/systemd/network/zz-default.network +++ b/systemd/network/zz-default.network @@ -1,14 +1,13 @@ +[Match] +# Only virtual NICs have a Kind, and we want to exclude those. +Kind=!?* +Type=!loopback + [Network] DHCP=yes -KeepConfiguration=dhcp-on-stop +KeepConfiguration=dynamic-on-stop IPv6AcceptRA=true -[Match] -Name=* -Type=!loopback bridge tunnel vxlan wireguard -Driver=!veth tun dummy -Kind=!tun bridge gre veth wireguard - [DHCP] UseMTU=true UseDomains=true diff --git a/systemd/system/oem-cloudinit.service b/systemd/system/oem-cloudinit.service index 86d5ef7..cb8d46e 100644 --- a/systemd/system/oem-cloudinit.service +++ b/systemd/system/oem-cloudinit.service @@ -4,8 +4,8 @@ Description=Run cloudinit [Service] EnvironmentFile=/var/run/ignition.env Type=oneshot -ExecCondition=/usr/bin/bash -xc 'OEMS=(aws gcp azure cloudsigma vmware digitalocean openstack); echo $${OEMS[*]} | tr " " "\n" | grep -q -x -F "${OEM_ID}"' -ExecStart=/usr/bin/bash -xc '/usr/bin/coreos-cloudinit --oem="$(if [ "${OEM_ID}" = aws -o "${OEM_ID}" = openstack ]; then echo ec2-compat; elif [ "${OEM_ID}" = gcp ]; then echo gce; else echo "${OEM_ID}" ; fi)"' +ExecCondition=bash -xc 'case ${OEM_ID} in aws|azure|cloudsigma|digitalocean|gcp|openstack|vmware) true;; *) false;; esac' +ExecStart=bash -xc 'exec coreos-cloudinit --oem="$(case ${OEM_ID} in aws|openstack) echo ec2-compat;; gcp) echo gce;; *) printf "%s" "${OEM_ID}";; esac)"' [Install] WantedBy=multi-user.target