From 5f5aedb730d3ac6bec7dd28cdb809d4d8b8d2049 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 26 Jun 2024 18:47:51 +0100 Subject: [PATCH] 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. --- cookbooks/networking/templates/default/network.erb | 6 ++++++ 1 file changed, 6 insertions(+) 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] -- 2.39.5