From fba4fdb729d2f0a74031135b4c2a842b8165fb9d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 21 Mar 2023 11:24:11 +0000 Subject: [PATCH] Ignore additional routes that point at ourselves --- cookbooks/networking/templates/default/network.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cookbooks/networking/templates/default/network.erb b/cookbooks/networking/templates/default/network.erb index ea414bd37..6e1493738 100644 --- a/cookbooks/networking/templates/default/network.erb +++ b/cookbooks/networking/templates/default/network.erb @@ -31,6 +31,7 @@ Metric=<%= @interface[:metric] %> <% end -%> <% end -%> <% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%> +<% unless details[:via] == @interface[:inet][:address] -%> [Route] <% if details[:via] -%> @@ -44,7 +45,9 @@ Metric=<%= details[:metric] %> Type=<%= details[:type] %> <% end -%> <% end -%> +<% end -%> <% Hash(@interface.dig(:inet6, :routes)).sort.each do |destination, details| -%> +<% unless details[:via] == @interface[:inet6][:address] -%> [Route] <% if details[:via] -%> @@ -58,3 +61,4 @@ Metric=<%= details[:metric] %> Type=<%= details[:type] %> <% end -%> <% end -%> +<% end -%> -- 2.39.5