Refetch final interface details before configuring netplan
authorTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 17:32:14 +0000 (17:32 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 17:32:14 +0000 (17:32 +0000)
cookbooks/networking/recipes/default.rb

index ae3a91d..f6015a1 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,