X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/29d741d17b7f029b4313d70182cfcc6f7c333a06..5c47d954b6d631cba545ba5793c11c1cc90e37ce:/cookbooks/networking/templates/default/interfaces.erb diff --git a/cookbooks/networking/templates/default/interfaces.erb b/cookbooks/networking/templates/default/interfaces.erb index 50238cb5f..4d1f277e5 100644 --- a/cookbooks/networking/templates/default/interfaces.erb +++ b/cookbooks/networking/templates/default/interfaces.erb @@ -3,6 +3,15 @@ iface lo inet loopback <% node[:networking][:interfaces].each do |name,interface| -%> <% if interface[:interface] -%> +<% if interface[:bond] -%> +<% interface[:bond][:slaves].each do |slave| -%> + +iface <%= slave %> inet manual + bond-master <%= interface[:interface] %> +<% end -%> + +auto <%= interface[:bond][:slaves].sort.uniq.join(" ") %> +<% end -%> iface <%= interface[:interface] %> <%= interface[:family] %> static address <%= interface[:address] %> @@ -31,6 +40,14 @@ iface <%= interface[:interface] %> <%= interface[:family] %> static <% if interface[:family] == "inet6" -%> autoconf 0 <% end -%> +<% if interface[:bond] -%> + bond-mode <%= interface[:bond][:mode] || "active-backup" %> + bond-slaves none + bond-primary <%= interface[:bond][:slaves].first %> + bond-miimon <%= interface[:bond][:miimon] || 100 %> + bond-downdelay <%= interface[:bond][:downdelay] || 200 %> + bond-updelay <%= interface[:bond][:updelay] || 200 %> +<% end -%> <% end -%> <% end -%>