From: Tom Hughes Date: Wed, 26 Jun 2024 17:47:51 +0000 (+0100) Subject: Fix online detection for bond interfaces X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5f5aedb730d3ac6bec7dd28cdb809d4d8b8d2049?ds=inline Fix online detection for bond interfaces With versions of systemd before 254 allow bond interfaces with a state of degraded-carrier so long as they have an address. --- diff --git a/cookbooks/networking/templates/default/network.erb b/cookbooks/networking/templates/default/network.erb index 796bf67d6..d2c34bfbf 100644 --- a/cookbooks/networking/templates/default/network.erb +++ b/cookbooks/networking/templates/default/network.erb @@ -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]