]> git.openstreetmap.org Git - chef.git/commitdiff
Blackhole unreachable Google IPv6 blocks on equinix machines
authorTom Hughes <tom@compton.nu>
Wed, 8 Jan 2020 14:19:10 +0000 (14:19 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 8 Jan 2020 14:25:19 +0000 (14:25 +0000)
cookbooks/networking/recipes/default.rb
roles/equinix.rb

index dfa73f196c5aa909e3203a5c20bb81c405aca570..afdbd7163b3444f68bd69ff263e37c20b58ffb84 100644 (file)
@@ -39,6 +39,7 @@ node[:networking][:interfaces].each do |name, interface|
       if role[interface[:family]]
         node.normal[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix]
         node.normal[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway]
+        node.normal[:networking][:interfaces][name][:routes] = role[interface[:family]][:routes]
       end
 
       node.normal[:networking][:interfaces][name][:metric] = role[:metric]
@@ -124,6 +125,20 @@ node[:networking][:interfaces].each do |name, interface|
         )
       end
     end
+
+    if interface[:routes]
+      interface[:routes].each do |to, parameters|
+        route = {
+          "to" => to
+        }
+
+        route["type"] = parameters[:type] if parameters[:type]
+        route["via"] = parameters[:via] if parameters[:via]
+        route["metric"] = parameters[:metric] if parameters[:metric]
+
+        deviceplan["routes"].push(route)
+      end
+    end
   else
     node.rm(:networking, :interfaces, name)
   end
index a35b4775c50b97526ad92825f812b937402d4396..7b58f7af7a6734b8f0397eb0dbf0676a8fd2c5a0 100644 (file)
@@ -19,7 +19,12 @@ default_attributes(
         },
         :inet6 => {
           :prefix => "64",
-          :gateway => "2001:978:2:2C::172:1"
+          :gateway => "2001:978:2:2C::172:1",
+          :routes => {
+            "2001:978:2:2c::/64" => { :type => "unreachable" },
+            "2001:4860::/32" => { :type => "unreachable" },
+            "2a00:1450:4000::/37" => { :type => "unreachable" }
+          }
         }
       }
     }