X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/9ac3f14227e8bb96030642c60ec7adb51d36f01c..c6902ea9afba17351101f28b4a401e5193b89c1b:/cookbooks/networking/recipes/default.rb diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index ae3a91d00..822f9042f 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -50,6 +50,8 @@ node[:networking][:interfaces].each do |name, interface| node.normal[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix) node.normal[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) + interface = node[:networking][:interfaces][name] + deviceplan = if interface[:interface] =~ /^(.*)\.(\d+)$/ netplan["network"]["vlans"][interface[:interface]] ||= { "id" => Regexp.last_match(2).to_i, @@ -74,6 +76,10 @@ node[:networking][:interfaces].each do |name, interface| deviceplan["addresses"].push("#{interface[:address]}/#{prefix}") + if interface[:mtu] + deviceplan["mtu"] = interface[:mtu] + end + if interface[:bond] deviceplan["interfaces"] = interface[:bond][:slaves].to_a