update head template

This commit is contained in:
Arne Teuke
2025-02-12 11:45:09 +01:00
parent 9aa0ff0451
commit 4316a4dad7
3 changed files with 19 additions and 14 deletions

View File

@@ -74,16 +74,16 @@ $hy_pid = '/var/run/haproxy.pid',
$hy_maxconn = '4000', $hy_maxconn = '4000',
$hy_show_stats = true, $hy_show_stats = true,
$hy_stats_socket = '/var/lib/haproxy/stats', $hy_stats_socket = '/var/lib/haproxy/stats',
$hy_default_mode = 'http', $hy_default_mode = 'tcp',
$hy_use_http_server_close = false, $hy_use_http_server_close = false,
$hy_use_forward_for = false, $hy_use_forward_for = false,
$hy_use_redispatch = false, $hy_use_redispatch = true,
$hy_max_retries = '3', $hy_max_retries = '3',
$hy_timeout_http_request = '10s', $hy_timeout_http_request = '10s',
$hy_timeout_queue = '1m', $hy_timeout_queue = '1m',
$hy_timeout_connect = '10s', $hy_timeout_connect = '5000',
$hy_timeout_client = '1m', $hy_timeout_client = '50000',
$hy_timeout_server = '1m', $hy_timeout_server = '50000',
$hy_timeout_http_keep_alive = '10s', $hy_timeout_http_keep_alive = '10s',
$hy_timeout_check = '10s', $hy_timeout_check = '10s',
@@ -94,12 +94,16 @@ $hy_user_home = '/var/lib/haproxy',
$hy_user_shell = '/sbin/nologin', $hy_user_shell = '/sbin/nologin',
# logging # logging
$hy_log_local0 = true,
$hy_log_local1 = true,
$hy_log_target = '127.0.0.1', $hy_log_target = '127.0.0.1',
$hy_log_facility = 'local2', $hy_log_facility = 'local2',
$hy_log_default = 'global', $hy_log_default = 'global',
$hy_use_tcplog = true,
$hy_use_httplog = false, $hy_use_httplog = false,
$hy_use_dontlognull = true, $hy_use_dontlognull = true,
) { ) {
# service # service

View File

@@ -44,7 +44,6 @@ define cd_haproxy::server::proxy (
$fe_http_request = '', $fe_http_request = '',
$backend_configs = [], $backend_configs = [],
) { ) {
$hy_main_config = '/etc/haproxy/haproxy.cfg' $hy_main_config = '/etc/haproxy/haproxy.cfg'
@@ -79,12 +78,7 @@ define cd_haproxy::server::proxy (
'order' => $backend_order, 'order' => $backend_order,
}) })
# open sepcific firewall ports
# # create backend section
# concat::fragment { "backend_${name}":
# target => $hy_main_config,
# content => template($hy_backendrule),
# order => $backend_order,
# }
} }

View File

@@ -3,8 +3,12 @@
############################################################################### ###############################################################################
global global
log <%= @hy_log_target %> <%= @hy_log_facility %> <% if @hy_log_local0 == true -%>
log /dev/log local0
<% end -%>
<% if @hy_log_local1 == true -%>
log /dev/log local1 notice
<% end -%>
chroot <%= @hy_chroot %> chroot <%= @hy_chroot %>
pidfile <%= @hy_pid %> pidfile <%= @hy_pid %>
maxconn <%= @hy_maxconn %> maxconn <%= @hy_maxconn %>
@@ -24,6 +28,9 @@ global
defaults defaults
mode <%= @hy_default_mode %> mode <%= @hy_default_mode %>
log global log global
<% if @hy_use_tcplog == true -%>
option tcplog
<% end -%>
<% if @hy_use_httplog == true -%> <% if @hy_use_httplog == true -%>
option httplog option httplog
<% end -%> <% end -%>