adds global section
This commit is contained in:
@@ -45,5 +45,17 @@ class cd_haproxy::main::files (
|
|||||||
content => template($hy_config_head_erb),
|
content => template($hy_config_head_erb),
|
||||||
order => '001',
|
order => '001',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# pid file
|
||||||
|
file { $hy_pid:
|
||||||
|
ensure => file,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => '0644',
|
||||||
|
selrange => s0,
|
||||||
|
selrole => object_r,
|
||||||
|
seltype => haproxy_var_run_t,
|
||||||
|
seluser => system_u,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,16 @@
|
|||||||
# @param [string] hy_user_name the name of the haproxy service user.
|
# @param [string] hy_user_name the name of the haproxy service user.
|
||||||
# @param [string] hy_user_comment the comment of the haproxy user, shows up
|
# @param [string] hy_user_comment the comment of the haproxy user, shows up
|
||||||
# in emails sent from haproxy.
|
# in emails sent from haproxy.
|
||||||
# @param [string] hy_user_shell the shell for the haproxy user.
|
# @param [string] hy_user_home the home directory for the haprxy user.
|
||||||
|
# @param [string] hy_user_shell the shell for the haproxy user.
|
||||||
|
# @param [string] hy_log_target Where to send the logs for this haproxy.
|
||||||
|
# Currently only local logging / rsyslog forwarding supported.
|
||||||
|
# @param [string] hy_log_facility which logging facility to use.
|
||||||
|
# @param [string] hy_chroot where the chroot should be
|
||||||
|
# @param [string] hy_pid the pid file to use.
|
||||||
|
# @param [string] hy_maxconn how many connections should we max allow.
|
||||||
|
# @param [boolean] hy_show_stats whether we want to display the statistics page
|
||||||
|
# @param [string] hy_stats_socket name and path of the stats socket
|
||||||
###############################################################################
|
###############################################################################
|
||||||
class cd_haproxy::params (
|
class cd_haproxy::params (
|
||||||
|
|
||||||
@@ -57,6 +66,15 @@ $hy_user_comment = 'haproxy user',
|
|||||||
$hy_user_home = '/var/lib/haproxy',
|
$hy_user_home = '/var/lib/haproxy',
|
||||||
$hy_user_shell = '/sbin/nologin',
|
$hy_user_shell = '/sbin/nologin',
|
||||||
|
|
||||||
|
# logging
|
||||||
|
$hy_log_target = '127.0.0.1',
|
||||||
|
$hy_log_facility = 'local2',
|
||||||
|
$hy_chroot = '/var/lib/haproxy',
|
||||||
|
$hy_pid = '/var/run/haproxy.pid',
|
||||||
|
$hy_maxconn = '4000',
|
||||||
|
$hy_show_stats = true,
|
||||||
|
$hy_stats_socket = '/var/lib/haproxy/stats',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# service
|
# service
|
||||||
|
|||||||
@@ -3,3 +3,17 @@
|
|||||||
##### will be overwritten. original full file available at #####
|
##### will be overwritten. original full file available at #####
|
||||||
##### https://confdroid.com/2018/12/haproxy-cfg/ #####
|
##### https://confdroid.com/2018/12/haproxy-cfg/ #####
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
global
|
||||||
|
log <%= @hy_log_target %> <%= @hy_log_facility %>
|
||||||
|
|
||||||
|
chroot <%= @hy_chroot %>
|
||||||
|
pidfile <%= @hy_pid %>
|
||||||
|
maxconn <%= @hy_maxconn %>
|
||||||
|
user <%= @hy_user_name %>
|
||||||
|
group <%= @hy_user_name %>
|
||||||
|
daemon
|
||||||
|
|
||||||
|
<% if @hy_show_stats == true -%>
|
||||||
|
stats socket <%= @hy_stats_socket %>
|
||||||
|
<% end -%>
|
||||||
|
|||||||
Reference in New Issue
Block a user