]> git.openstreetmap.org Git - chef.git/commitdiff
systemd-networkd-wait-online waiting for timeout in dokken
authorGrant Slater <github@firefishy.com>
Wed, 24 Apr 2024 16:21:26 +0000 (17:21 +0100)
committerGrant <github@firefishy.com>
Wed, 24 Apr 2024 19:18:05 +0000 (20:18 +0100)
cookbooks/networking/recipes/default.rb
cookbooks/networking/templates/default/dokken.network.erb [new file with mode: 0644]

index 103f8823ba4ca6bc8d59c662694bd961e7fcb44c..ea87c3b7b0b4ab94264d558bcf5571c46dc54dcf 100644 (file)
@@ -266,6 +266,16 @@ if node[:networking][:wireguard][:enabled]
   end
 end
 
   end
 end
 
+# Setup dokken network in systemd-networkd to avoid systemd-networkd-wait-online delay
+template "/etc/systemd/network/dokken.network" do
+  source "dokken.network.erb"
+  owner "root"
+  group "root"
+  mode "644"
+  notifies :run, "execute[networkctl-reload]", :immediately
+  only_if { kitchen? }
+end
+
 notify_group "networkctl-reload"
 
 execute "networkctl-reload" do
 notify_group "networkctl-reload"
 
 execute "networkctl-reload" do
diff --git a/cookbooks/networking/templates/default/dokken.network.erb b/cookbooks/networking/templates/default/dokken.network.erb
new file mode 100644 (file)
index 0000000..bf46c95
--- /dev/null
@@ -0,0 +1,10 @@
+[Match]
+Name=eth0
+
+[Link]
+RequiredForOnline=routable
+
+[Network]
+DHCP=no
+LinkLocalAddressing=no
+KeepConfiguration=yes