node.normal[:networking][:interfaces][name][:zone] = role[:zone]
end
- prefix = node[:networking][:interfaces][name][:prefix]
+ if interface[:address]
+ prefix = node[:networking][:interfaces][name][:prefix]
- 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)
+ 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)
+ end
interface = node[:networking][:interfaces][name]
}
end
- deviceplan["addresses"].push("#{interface[:address]}/#{prefix}")
+ if interface[:address]
+ deviceplan["addresses"].push("#{interface[:address]}/#{prefix}")
+ end
if interface[:mtu]
deviceplan["mtu"] = interface[:mtu]
plugin "hostname"
end
-execute "hostnamectl-set-static" do
- command "hostnamectl set-static #{node[:networking][:hostname]}"
+execute "hostnamectl-set-hostname" do
+ command "hostnamectl set-hostname #{node[:networking][:hostname]}"
notifies :reload, "ohai[reload-hostname]"
not_if { ENV.key?("TEST_KITCHEN") || node[:hostnamectl][:static_hostname] == node[:networking][:hostname] }
end