From b9e7570e72dac2df62d2ba80b01e3ff534316517 Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Fri, 22 Nov 2024 18:48:55 -0800 Subject: [PATCH] devconfig: remove 89-ethernet.network The work on commit 683610d655563 ("debian: install /etc/systemd/network/89-ethernet.network") tried to do the best we can with the willy bug present on systemd-networkd-wait-online.service where if that service is enabled and you have no configuration for ethernet the service never completes and fails and this can often cause some services to time out that we may want to setup. It turns out that adding our own /etc/systemd/network/89-ethernet.network just to annotate we need dhcp is not sufficient to fix the issue across all the self-hosted runners used by kdevops. Although many CIs are not affected one system, the one used for the linux-firmware CI using the linux-firwmare-kpd kept failing at bringup. Upon closer inspection on the console, even if we upgraded the host and rebooted into the latest debian testing packages, the host still had issues. The console on the guest revealed that the IP address shifted when the file 89-ethernet.network was installed and the server restarted, so the timeout on bringup was caused because the IP address we obtained first for ssh-detection changed, so we can no longer connect to the guest. Strange enough, if you reboot the guest we see the guest afterwards gets *two* IP addresses assigned! This is just nuts. So disable systemd-networkd-wait-online.service as that is completely buggy and I don't think folks really thought this out well. Fixes: 683610d655563 ("debian: install /etc/systemd/network/89-ethernet.network") Signed-off-by: Luis Chamberlain --- .../roles/devconfig/tasks/install-deps/debian/main.yml | 8 +------- .../roles/devconfig/templates/89-ethernet.network.j2 | 9 --------- scripts/bringup_guestfs.sh | 9 --------- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 playbooks/roles/devconfig/templates/89-ethernet.network.j2 diff --git a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml index 53a3d451..c8c18bb0 100644 --- a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +++ b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml @@ -40,15 +40,9 @@ - apt-daily.timer - apt-daily-upgrade.service - apt-daily-upgrade.timer + - systemd-networkd-wait-online.service ignore_errors: yes -- name: Set up 89-ethernet.network - become: yes - become_method: sudo - template: - src: 89-ethernet.network.j2 - dest: /etc/systemd/network/89-ethernet.network - - name: Allow for distro source change / upgrade become: yes become_flags: 'su - -c' diff --git a/playbooks/roles/devconfig/templates/89-ethernet.network.j2 b/playbooks/roles/devconfig/templates/89-ethernet.network.j2 deleted file mode 100644 index f882f13f..00000000 --- a/playbooks/roles/devconfig/templates/89-ethernet.network.j2 +++ /dev/null @@ -1,9 +0,0 @@ -# kdevops generated 89-ethernet.network -# Enable DHCPv4 and DHCPv6 on all physical ethernet links -# systemd-networkd-wait-online.service likes to fail on an empty /etc/systemd/network/ -# and we may leverage systemd-networkd-wait-online.service for other services. -[Match] -Kind=!* -Type=ether -[Network] -DHCP=yes diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index f68f4d35..74eeceac 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -250,15 +250,6 @@ uninstall cloud-init write /etc/default/locale:LANG=en_US.UTF-8 append-line /etc/default/locale:LANGUAGE=en_US:en write /etc/locale.gen:en_US.UTF-8 UTF-8 -write /etc/systemd/network/89-ethernet.network: # kdevops generated 89-ethernet.network -append-line write /etc/systemd/network/89-ethernet.network:# Enable DHCPv4 and DHCPv6 on all physical ethernet links -append-line write /etc/systemd/network/89-ethernet.network:# systemd-networkd-wait-online.service likes to fail on an empty /etc/systemd/network/ -append-line write /etc/systemd/network/89-ethernet.network:# and we may leverage systemd-networkd-wait-online.service for other services. -append-line write /etc/systemd/network/89-ethernet.network:[Match] -append-line write /etc/systemd/network/89-ethernet.network:Kind=!* -append-line write /etc/systemd/network/89-ethernet.network:Type=ether -append-line write /etc/systemd/network/89-ethernet.network:[Network] -append-line write /etc/systemd/network/89-ethernet.network:DHCP=yes firstboot-command locale-gen en_US.UTF-8 firstboot-command update-locale LANG=en_US.UTF-8 firstboot-command DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -p low --force locales