add tcp_option

This commit is contained in:
Arne Teuke
2025-01-29 23:02:45 +01:00
parent 0f136d567b
commit f646e5613e
2 changed files with 8 additions and 17 deletions

View File

@@ -1,23 +1,6 @@
## cd_haproxy::server::proxy.pp ## cd_haproxy::server::proxy.pp
# Module name: cd_haproxy # Module name: cd_haproxy
# Author: Arne Teuke (arne_teuke@ConfDroid.com) # Author: Arne Teuke (arne_teuke@ConfDroid.com)
# # License:
# This file is part of cd_haproxy.
#
# cd_haproxy is used for providing automatic configuration of HAProxy
# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# @summary Define manages the proxies for cd_haproxy. # @summary Define manages the proxies for cd_haproxy.
# @param [string] haproxy_fqdn the fqdn of the haproxy server in question. # @param [string] haproxy_fqdn the fqdn of the haproxy server in question.
# @param [string] frontend_name the name for the frontend section rule. # @param [string] frontend_name the name for the frontend section rule.
@@ -56,6 +39,7 @@ define cd_haproxy::server::proxy (
$be_mode = '', $be_mode = '',
$default_backend = '', $default_backend = '',
$be_option = '', $be_option = '',
$fe_tcp_request = '',
) { ) {
@@ -72,6 +56,7 @@ define cd_haproxy::server::proxy (
$backend_name_array = split($backend_name, ';') $backend_name_array = split($backend_name, ';')
$be_server_name_array = split($be_server_name, ';') $be_server_name_array = split($be_server_name, ';')
$be_option_array = split($be_option, ';') $be_option_array = split($be_option, ';')
$fe_tcp_request_array = split($fe_tcp_request, ';')
# create frontend section # create frontend section
concat::fragment { "frontend_${name}": concat::fragment { "frontend_${name}":

View File

@@ -6,6 +6,12 @@ bind <%= @fe_bind_mode %>
<% if @fe_maxconn != '' -%> <% if @fe_maxconn != '' -%>
maxconn <%= @fe_maxconn %> maxconn <%= @fe_maxconn %>
<% end -%> <% end -%>
<% if @fe_tcp_request_array and !@fe_tcp_request_array.empty? -%>
<% @fe_tcp_request_array.each do |fe_tcp_request| -%>
acl <%= fe_tcp_request %>
<% end -%>
<% end -%>
<% if @acl_rule_front_array and !@acl_rule_front_array.empty? -%> <% if @acl_rule_front_array and !@acl_rule_front_array.empty? -%>
<% @acl_rule_front_array.each do |acl_rule_front| -%> <% @acl_rule_front_array.each do |acl_rule_front| -%>
acl <%= acl_rule_front %> acl <%= acl_rule_front %>