Skip to content

Commit

Permalink
debian: install /etc/systemd/network/89-ethernet.network
Browse files Browse the repository at this point in the history
Experience shows systemd-networkd-wait-online.service is that
an empty /etc/systemd/network/ will yield to a failure in
systemd-networkd-wait-online.service and this can often lead to
false positive starts and also gives us the impression something
is wrong.

This is likeley an upstream systemd bug... but... let's just work around
this crap at least on debian for now, and we can deal with a generic
solution if other distributions also end up with an empty
/etc/systemd/network/ and this fails.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
mcgrof committed Nov 13, 2024
1 parent 39aeba4 commit 683610d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions playbooks/roles/devconfig/tasks/install-deps/debian/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
- apt-daily-upgrade.timer
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'
Expand Down
9 changes: 9 additions & 0 deletions playbooks/roles/devconfig/templates/89-ethernet.network.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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
9 changes: 9 additions & 0 deletions scripts/bringup_guestfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ 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
Expand Down

0 comments on commit 683610d

Please # to comment.