X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/cf833e682dfb839d99676c141c8b2b6a8e1b7ab7..a31229e5ab1291d79d14ac9bf4ad210db4895cea:/cookbooks/networking/recipes/default.rb diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 8355b54c0..e23b1dae3 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -22,7 +22,12 @@ require "ipaddr" +network_packages = [] + node[:networking][:interfaces].each do |name, interface| + network_packages |= ["vlan"] if interface[:interface] =~ /\.\d+$/ + network_packages |= ["ifenslave"] if interface[:bond] + if interface[:role] && (role = node[:networking][:roles][interface[:role]]) if role[interface[:family]] node.set[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] @@ -39,6 +44,8 @@ node[:networking][:interfaces].each do |name, interface| node.set[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) end +package network_packages + template "/etc/network/interfaces" do source "interfaces.erb" owner "root"