]> git.openstreetmap.org Git - chef.git/commitdiff
Ignore additional routes that point at ourselves
authorTom Hughes <tom@compton.nu>
Tue, 21 Mar 2023 11:24:11 +0000 (11:24 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 21 Mar 2023 11:31:04 +0000 (11:31 +0000)
cookbooks/networking/templates/default/network.erb

index ea414bd37af14aca1a3f92108d16118688cbda5d..6e1493738961b34c78e875936facd79ad849b75c 100644 (file)
@@ -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 -%>