]> git.openstreetmap.org Git - chef.git/commitdiff
Only configure a primary slave in active-backup mode
authorTom Hughes <tom@compton.nu>
Thu, 20 Oct 2022 22:53:32 +0000 (23:53 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 20 Oct 2022 22:53:32 +0000 (23:53 +0100)
cookbooks/networking/recipes/default.rb

index 0ae4a12fba08fe03a132d5d3a0d2f2dc955c9f2c..5cdaf91f635fc5bc894e454e6002407e71cfbe71 100644 (file)
@@ -94,12 +94,12 @@ node[:networking][:interfaces].each do |name, interface|
 
       deviceplan["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["parameters"]["primary"] = interface[:bond][:slaves].first if deviceplan["parameters"]["mode"] == "active-backup"
       deviceplan["parameters"]["transmit-hash-policy"] = interface[:bond][:xmithashpolicy] if interface[:bond][:xmithashpolicy]
       deviceplan["parameters"]["lacp-rate"] = interface[:bond][:lacprate] if interface[:bond][:lacprate]
     end