Skip to content

Commit a297b0f

Browse files
committed
haproxy v1.0.2, fix regression introduced in v1.0.1
1 parent b3bb713 commit a297b0f

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ Installs haproxy and prepares the configuration location.
66
Changes
77
=======
88

9+
## v1.0.2:
10+
11+
* fix regression introduced in v1.0.1
12+
13+
## v1.0.1:
14+
15+
* account for the case where load balancer is in the pool
16+
917
## v1.0.0:
1018

1119
* Use `node.chef_environment` instead of `node['app_environment']`

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
license "Apache 2.0"
44
description "Installs and configures haproxy"
55
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6-
version "1.0.1"
6+
version "1.0.2"
77

88
recipe "haproxy", "Installs and configures haproxy"
99
recipe "haproxy::app_lb", "Installs and configures haproxy by searching for nodes of a particular role"

recipes/app_lb.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
# limitations under the License.
1818
#
1919

20-
pool_members = []
21-
# if we are the load balancer and pool
20+
pool_members = search("node", "role:#{node['haproxy']['app_server_role']} AND chef_environment:#{node.chef_environment}") || []
21+
22+
# load balancer is in the pool
2223
if node.run_list.roles.include?(node['haproxy']['app_server_role'])
2324
pool_members << node
24-
else
25-
pool_members << search("node", "role:#{node['haproxy']['app_server_role']} AND chef_environment:#{node.chef_environment}")
2625
end
2726

2827
package "haproxy" do
@@ -46,6 +45,6 @@
4645
owner "root"
4746
group "root"
4847
mode 0644
49-
variables :pool_members => pool_members
48+
variables :pool_members => pool_members.uniq
5049
notifies :restart, "service[haproxy]"
5150
end

0 commit comments

Comments
 (0)