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]
)
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
},
: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" }
+ }
}
}
}