summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorHunter Haugen <h.haugen@gmail.com>2012-10-12 14:41:33 -0700
committerHunter Haugen <h.haugen@gmail.com>2012-10-12 14:41:33 -0700
commita7498ce016087872488e60a2b80680a2096fbf68 (patch)
treef7bb4197c4a22ccc893ad667ea5bdff4ef46445c /templates
parent362d0ebf99b9dbfde8027646a84bf35f809be64f (diff)
Update the haproxy::balancermember for multiple ports
Also, parameter changes: - `balancer_port` to `ports` - `server_name` to `server_names` - `balancer_ip` to `ipaddresses` - `balancermember_options` to `options`
Diffstat (limited to 'templates')
-rw-r--r--templates/haproxy_balancermember.erb6
1 files changed, 2 insertions, 4 deletions
diff --git a/templates/haproxy_balancermember.erb b/templates/haproxy_balancermember.erb
index fca4f0b..1d03f56 100644
--- a/templates/haproxy_balancermember.erb
+++ b/templates/haproxy_balancermember.erb
@@ -1,5 +1,3 @@
-<% for @ip,@host in Array(@balancer_ip).zip(Array(@server_name)) %> server <%= @host %> <%= @ip %>:<%= balancer_port %> <%
- items = balancermember_options
- items = [items] unless balancermember_options.instance_of? Array
- items.each do |item| %> <%= item %><% end %>
+<% Array(ipaddresses).zip(Array(server_names)).each do |ipaddress,host| -%>
+ server <%= host %> <%= ipaddress %>:<%= Array(ports).collect {|x|x.split(',')}.flatten.join(",#{ipaddress}:") %> <%= Array(options).join(" ") %>
<% end %>