From 7d2e04e68a9c4e35acfd1e49d003ce4c07ee0e2f Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Sun, 30 Dec 2018 18:16:09 +0100 Subject: [PATCH] testing hostbinding --- manifests/server/proxy.pp | 1 + templates/haproxy_acl_rule.erb | 3 ++- templates/haproxy_backend_rule.erb | 3 ++- templates/haproxy_frontend_rule.erb | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/server/proxy.pp b/manifests/server/proxy.pp index f4ced2e..e39cb79 100644 --- a/manifests/server/proxy.pp +++ b/manifests/server/proxy.pp @@ -25,6 +25,7 @@ ############################################################################# define cd_haproxy::server::proxy ( +$haproxy_fqdn = undef, $frontend_name = undef, $frontend_mode = undef, $fe_use_backend = '', diff --git a/templates/haproxy_acl_rule.erb b/templates/haproxy_acl_rule.erb index 127c88c..3584f0a 100644 --- a/templates/haproxy_acl_rule.erb +++ b/templates/haproxy_acl_rule.erb @@ -1,4 +1,5 @@ +<% if @fqdn == @haproxy_fqdn -%> <% if @acl_rule != '' -%> <% @acl_rule.each do |acl_rule| -%> acl <%= acl_rule %> -<% end end -%> +<% end end end -%> diff --git a/templates/haproxy_backend_rule.erb b/templates/haproxy_backend_rule.erb index 9b3cda6..29ff35f 100644 --- a/templates/haproxy_backend_rule.erb +++ b/templates/haproxy_backend_rule.erb @@ -1,2 +1,3 @@ - +<% if @fqdn == @haproxy_fqdn -%> backend <%= @backend_name %> +<% end -% diff --git a/templates/haproxy_frontend_rule.erb b/templates/haproxy_frontend_rule.erb index 5479b44..60616ec 100644 --- a/templates/haproxy_frontend_rule.erb +++ b/templates/haproxy_frontend_rule.erb @@ -1,3 +1,4 @@ +<% if @fqdn == @haproxy_fqdn -%> frontend <%= @frontend_name %> mode <%= @frontend_mode %> bind <%= @fe_bind_mode %> @@ -5,4 +6,4 @@ bind <%= @fe_bind_mode %> use_backend <%= @fe_use_backend %> <% else -%> use_backend <%= @backend_name %> -<% end -%> +<% end end-%>