From c4799e59b9d9891e6c296c554a11814f14a5abfc Mon Sep 17 00:00:00 2001 From: Gary Larizza Date: Mon, 7 May 2012 14:26:21 -0700 Subject: Initial Commit --- templates/haproxy-base.cfg.erb | 21 +++++++++++++++++++++ templates/haproxy_balancermember.erb | 1 + templates/haproxy_config_block.erb | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 templates/haproxy-base.cfg.erb create mode 100644 templates/haproxy_balancermember.erb create mode 100644 templates/haproxy_config_block.erb (limited to 'templates') diff --git a/templates/haproxy-base.cfg.erb b/templates/haproxy-base.cfg.erb new file mode 100644 index 0000000..3e21436 --- /dev/null +++ b/templates/haproxy-base.cfg.erb @@ -0,0 +1,21 @@ +global +<% haproxy_global_options.sort.each do |key,val| -%> +<% if val.is_a?(Array) -%> +<% val.each do |item| -%> + <%= key %> <%= item %> +<% end -%> +<% else -%> + <%= key %> <%= val %> +<% end -%> +<% end -%> + +defaults +<% haproxy_defaults_options.sort.each do |key,val| -%> +<% if val.is_a?(Array) -%> +<% val.each do |item| -%> + <%= key %> <%= item %> +<% end -%> +<% else -%> + <%= key %> <%= val %> +<% end -%> +<% end -%> \ No newline at end of file diff --git a/templates/haproxy_balancermember.erb b/templates/haproxy_balancermember.erb new file mode 100644 index 0000000..b739e11 --- /dev/null +++ b/templates/haproxy_balancermember.erb @@ -0,0 +1 @@ + server <%= server_name %> <%= balancer_ip %>:<%= balancer_port %> <% balancermember_options.each do |item| %> <%= item %> <% end %> diff --git a/templates/haproxy_config_block.erb b/templates/haproxy_config_block.erb new file mode 100644 index 0000000..8737dfc --- /dev/null +++ b/templates/haproxy_config_block.erb @@ -0,0 +1,11 @@ + +listen <%= name %> <%= virtual_ip %>:<%= virtual_ip_port %> +<% haproxy_config_options.sort.each do |key, val| -%> +<% if val.is_a?(Array) -%> +<% val.each do |item| -%> + <%= key %> <%= item %> +<% end -%> +<% else -%> + <%= key %> <%= val %> +<% end -%> +<% end -%> -- cgit v1.2.3