Skip to content

Commit

Permalink
Sort pool members by hostname to avoid template modification and hapr…
Browse files Browse the repository at this point in the history
…oxy reload
  • Loading branch information
obazoud committed Jul 10, 2014
1 parent f51ba15 commit 5f1dbbc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions recipes/app_lb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
{:ipaddress => server_ip, :hostname => member['hostname']}
end

pool_members.sort! do |a,b|
a[:hostname].downcase <=> b[:hostname].downcase
end

pool = ["options httpchk #{node['haproxy']['httpchk']}"] if node['haproxy']['httpchk']
servers = pool_members.uniq.map do |s|
Expand Down

0 comments on commit 5f1dbbc

Please sign in to comment.