]> git.openstreetmap.org Git - chef.git/commitdiff
Fix online detection for bond interfaces
authorTom Hughes <tom@compton.nu>
Wed, 26 Jun 2024 17:47:51 +0000 (18:47 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 26 Jun 2024 17:48:59 +0000 (18:48 +0100)
With versions of systemd before 254 allow bond interfaces with
a state of degraded-carrier so long as they have an address.

cookbooks/networking/templates/default/network.erb

index 796bf67d6f4c51c69e3386fe4efe41a77fc99085..d2c34bfbf24559fe9dfc44e9c3c0e96fc9c7c960 100644 (file)
@@ -15,6 +15,12 @@ IPv6AcceptRA=no
 <% Array(@interface[:vlans]).sort.uniq.each do |vlan| -%>
 VLAN=<%= @interface[:interface] %>.<%= vlan %>
 <% end -%>
+<% if @interface[:interface] =~ /^bond\d+$/ && node[:packages][:systemd][:version].to_i < 254 -%>
+
+[Link]
+RequiredFamilyForOnline=ipv4
+RequiredForOnline=degraded-carrier
+<% end -%>
 <% if @interface.dig(:inet6, :dhcp) -%>
 
 [DHCPv6]