From: Tom Hughes Date: Sun, 8 May 2016 16:22:33 +0000 (+0100) Subject: Bring up slave interfaces X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/42e99538a6a521e8c6896a713ec136844d09a780?ds=inline Bring up slave interfaces --- diff --git a/cookbooks/networking/templates/default/interfaces.erb b/cookbooks/networking/templates/default/interfaces.erb index 1b3e1a989..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] %> @@ -33,7 +42,7 @@ iface <%= interface[:interface] %> <%= interface[:family] %> static <% end -%> <% if interface[:bond] -%> bond-mode <%= interface[:bond][:mode] || "active-backup" %> - bond-slaves <%= interface[:bond][:slaves].join(" ") %> + bond-slaves none bond-primary <%= interface[:bond][:slaves].first %> bond-miimon <%= interface[:bond][:miimon] || 100 %> bond-downdelay <%= interface[:bond][:downdelay] || 200 %>