Skip to content

Commit 683610d

Browse files
committed
debian: install /etc/systemd/network/89-ethernet.network
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 <[email protected]>
1 parent 39aeba4 commit 683610d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

playbooks/roles/devconfig/tasks/install-deps/debian/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
- apt-daily-upgrade.timer
4343
ignore_errors: yes
4444

45+
- name: Set up 89-ethernet.network
46+
become: yes
47+
become_method: sudo
48+
template:
49+
src: 89-ethernet.network.j2
50+
dest: /etc/systemd/network/89-ethernet.network
51+
4552
- name: Allow for distro source change / upgrade
4653
become: yes
4754
become_flags: 'su - -c'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# kdevops generated 89-ethernet.network
2+
# Enable DHCPv4 and DHCPv6 on all physical ethernet links
3+
# systemd-networkd-wait-online.service likes to fail on an empty /etc/systemd/network/
4+
# and we may leverage systemd-networkd-wait-online.service for other services.
5+
[Match]
6+
Kind=!*
7+
Type=ether
8+
[Network]
9+
DHCP=yes

scripts/bringup_guestfs.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ uninstall cloud-init
250250
write /etc/default/locale:LANG=en_US.UTF-8
251251
append-line /etc/default/locale:LANGUAGE=en_US:en
252252
write /etc/locale.gen:en_US.UTF-8 UTF-8
253+
write /etc/systemd/network/89-ethernet.network: # kdevops generated 89-ethernet.network
254+
append-line write /etc/systemd/network/89-ethernet.network:# Enable DHCPv4 and DHCPv6 on all physical ethernet links
255+
append-line write /etc/systemd/network/89-ethernet.network:# systemd-networkd-wait-online.service likes to fail on an empty /etc/systemd/network/
256+
append-line write /etc/systemd/network/89-ethernet.network:# and we may leverage systemd-networkd-wait-online.service for other services.
257+
append-line write /etc/systemd/network/89-ethernet.network:[Match]
258+
append-line write /etc/systemd/network/89-ethernet.network:Kind=!*
259+
append-line write /etc/systemd/network/89-ethernet.network:Type=ether
260+
append-line write /etc/systemd/network/89-ethernet.network:[Network]
261+
append-line write /etc/systemd/network/89-ethernet.network:DHCP=yes
253262
firstboot-command locale-gen en_US.UTF-8
254263
firstboot-command update-locale LANG=en_US.UTF-8
255264
firstboot-command DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -p low --force locales

0 commit comments

Comments
 (0)