diff --git a/manifests/server/proxy.pp b/manifests/server/proxy.pp index 6ea2fa9..d772187 100644 --- a/manifests/server/proxy.pp +++ b/manifests/server/proxy.pp @@ -41,6 +41,7 @@ define cd_haproxy::server::proxy ( $default_backend = '', $be_option = '', $fe_tcp_request = '', + $fe_req_add = '', ) { @@ -60,6 +61,7 @@ define cd_haproxy::server::proxy ( $be_option_array = split($be_option, ';') $fe_tcp_request_array = split($fe_tcp_request, ';') $fe_option_array = split($fe_option, ';') + $fe_req_add_array = split($fe_req_add, ';') # create frontend section concat::fragment { "frontend_${name}": diff --git a/templates/errors/503_http.erb b/templates/errors/503_http.erb index 3ca7c47..2b13247 100644 --- a/templates/errors/503_http.erb +++ b/templates/errors/503_http.erb @@ -9,6 +9,6 @@ Content-Type: text/html 503 Service Unavailable

503 Service Unavailable

-No server is available to handle this request. This is the default error file in haproxy. +No server is available to handle this request. diff --git a/templates/haproxy_frontend_rule.erb b/templates/haproxy_frontend_rule.erb index d78eead..f14c530 100644 --- a/templates/haproxy_frontend_rule.erb +++ b/templates/haproxy_frontend_rule.erb @@ -16,6 +16,12 @@ maxconn <%= @fe_maxconn %> option <%= fe_option %> <% end -%> <% end -%> +<% if @fe_req_add_array and !@fe_req_add_array.empty? -%> +<% @fe_req_add_array.each do |fe_req_add| -%> +reqadd <%= fe_req_add %> +<% end -%> +<% end -%> + <% if @fe_tcp_request_array and !@fe_tcp_request_array.empty? -%> <% @fe_tcp_request_array.each do |fe_tcp_request| -%> tcp-request <%= fe_tcp_request %>