Skip to content

Commit

Permalink
Merge pull request #157 from rightscale-cookbooks-contrib/ip_missing_79
Browse files Browse the repository at this point in the history
closes #79, does not include host if ip is null.
  • Loading branch information
rshade committed Jan 26, 2017
2 parents d36c26e + ac45ac4 commit 9555683
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file is used to list changes made in each version of the haproxy cookbook.
## v3.0.1 (tbc)

- adding tproxy and splice per [#98][]
- removing members with nil ips from member array. [#79][]

## v3.0.0 (2017-1-24)

Expand Down
6 changes: 5 additions & 1 deletion recipes/app_lb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
pool = ["option httpchk #{node['haproxy']['httpchk']}"] if node['haproxy']['httpchk']

servers = node['haproxy']['pool_members'].uniq.map do |s|
"#{s[:hostname]} #{s[:ipaddress]}:#{node['haproxy']['member_port']} weight 1 maxconn #{node['haproxy']['member_max_connections']} check"
if !s[:ipaddress].nil?
"#{s[:hostname]} #{s[:ipaddress]}:#{node['haproxy']['member_port']} weight 1 maxconn #{node['haproxy']['member_max_connections']} check"
else
Chef::Log.info "haproxy_host_missing_ip: #{s[:hostname]}"
end
end

haproxy_lb (node['haproxy']['mode']).to_s do
Expand Down

0 comments on commit 9555683

Please sign in to comment.