summaryrefslogtreecommitdiff
path: root/puppet/modules/haproxy/templates/haproxy_listen_block.erb
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/haproxy/templates/haproxy_listen_block.erb')
-rw-r--r--puppet/modules/haproxy/templates/haproxy_listen_block.erb10
1 files changed, 10 insertions, 0 deletions
diff --git a/puppet/modules/haproxy/templates/haproxy_listen_block.erb b/puppet/modules/haproxy/templates/haproxy_listen_block.erb
new file mode 100644
index 00000000..129313f1
--- /dev/null
+++ b/puppet/modules/haproxy/templates/haproxy_listen_block.erb
@@ -0,0 +1,10 @@
+listen <%= name %>
+ mode <%= mode %>
+<% Array(ipaddress).uniq.each do |virtual_ip| (ports.is_a?(Array) ? ports : Array(ports.split(","))).each do |port| %>
+ bind <%= virtual_ip %>:<%= port %>
+<% end end %>
+<% options.sort.each do |key, val| -%>
+<% Array(val).each do |item| -%>
+ <%= key %> <%= item %>
+<% end -%>
+<% end -%>