Skip to content

Commit

Permalink
haproxy v1.0.2, fix regression introduced in v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
schisamo committed Jun 8, 2011
1 parent 7794acd commit 0981c2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions haproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Installs haproxy and prepares the configuration location.
Changes
=======

## v1.0.2:

* fix regression introduced in v1.0.1

## v1.0.1:

* account for the case where load balancer is in the pool

## v1.0.0:

* Use `node.chef_environment` instead of `node['app_environment']`
Expand Down
2 changes: 1 addition & 1 deletion haproxy/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures haproxy"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.1"
version "1.0.2"

recipe "haproxy", "Installs and configures haproxy"
recipe "haproxy::app_lb", "Installs and configures haproxy by searching for nodes of a particular role"
Expand Down
9 changes: 4 additions & 5 deletions haproxy/recipes/app_lb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
# limitations under the License.
#

pool_members = []
# if we are the load balancer and pool
pool_members = search("node", "role:#{node['haproxy']['app_server_role']} AND chef_environment:#{node.chef_environment}") || []

# load balancer is in the pool
if node.run_list.roles.include?(node['haproxy']['app_server_role'])
pool_members << node
else
pool_members << search("node", "role:#{node['haproxy']['app_server_role']} AND chef_environment:#{node.chef_environment}")
end

package "haproxy" do
Expand All @@ -46,6 +45,6 @@
owner "root"
group "root"
mode 0644
variables :pool_members => pool_members
variables :pool_members => pool_members.uniq
notifies :restart, "service[haproxy]"
end

0 comments on commit 0981c2e

Please sign in to comment.