]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/networking/recipes/default.rb
Make munin use the node name instead of the FQDN
[chef.git] / cookbooks / networking / recipes / default.rb
index ae3a91d00b0e409573e93a473e74351bef021e9e..822f9042f1c0c89929b05e228e05aa679c4b2ed6 100644 (file)
@@ -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