From 047495a6199cf3c78b55bfd2c1b096863ca5fa0d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 20 Mar 2019 09:01:24 +0000 Subject: [PATCH] Fix setting of bond parameters --- cookbooks/networking/recipes/default.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 04c1c6258..2c7ca3e01 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -70,15 +70,17 @@ node[:networking][:interfaces].each do |name, interface| "addresses" => [], "routes" => [], "interfaces" => interface[:bond][:slaves].to_a, - "mode" => interface[:bond][:mode] || "active-backup", - "primary" => interface[:bond][:slaves].first, - "mii-monitor-interval" => interface[:bond][:miimon] || 100, - "down-delay" => interface[:bond][:downdelay] || 200, - "up-delay" => interface[:bond][:updelay] || 200 + "parameters" => { + "mode" => interface[:bond][:mode] || "active-backup", + "primary" => interface[:bond][:slaves].first, + "mii-monitor-interval" => interface[:bond][:miimon] || 100, + "down-delay" => interface[:bond][:downdelay] || 200, + "up-delay" => interface[:bond][:updelay] || 200 + } } - deviceplan["transmit-hash-policy"] = interface[:bond][:xmithashpolicy] if interface[:bond][:xmithashpolicy] - deviceplan["lacp-rate"] = interface[:bond][:lacprate] if interface[:bond][:lacprate] + deviceplan["parameters"]["transmit-hash-policy"] = interface[:bond][:xmithashpolicy] if interface[:bond][:xmithashpolicy] + deviceplan["parameters"]["lacp-rate"] = interface[:bond][:lacprate] if interface[:bond][:lacprate] else deviceplan = netplan["network"]["ethernets"][interface[:interface]] = { "accept-ra" => false, -- 2.43.2