145 lines
6.1 KiB
ObjectPascal
145 lines
6.1 KiB
ObjectPascal
## cd_haproxy::params.pp
|
|
# Module name: cd_haproxy
|
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
|
# @param [string] pkg_ensure
|
|
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
|
# to choose, i.e. `latest` or `present`.
|
|
# @param [string] reqpackages specify th epackages to be installed
|
|
# @param [string] hy_host_fqdn the fqdn of the ha proxy host. mmust be fqdn,
|
|
# not cname. specify multiple fqdns via array.
|
|
# @param [boolean] hy_manage_fw whether to manage the firewall.
|
|
# @param [string] hy_fw_order_no the rule number to control the oder of the
|
|
# firewall rules.
|
|
# @param [string] hy_http_port the http port. used in firewall settings
|
|
# @param [string] hy_https_port the https port. used in firewall settings
|
|
# @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
|
|
# in emails sent from haproxy.
|
|
# @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
|
|
# @param [string] hy_default_mode which mode to use in the defaults block
|
|
# @param [string] hy_log_default should be used when the instance's logging
|
|
# parameters are the same as the global ones.
|
|
# @param [boolean] hy_use_httplog whether to use httplogging option. Enable
|
|
# logging of HTTP request, session state and timers
|
|
# @param [boolean] hy_use_dontlognull Whether to enable or disable dontlognull
|
|
# option. true enables, false disables.
|
|
# @param [boolean] hy_use_http_server_close Enable or disable HTTP connection
|
|
# closing on the server side
|
|
# @param [boolean] hy_use_forward_for Enable insertion of the
|
|
# X-Forwarded-For header to requests sent to servers.
|
|
# @param [boolean] hy_use_redispatch Enable or disable session redistribution
|
|
# in case of connection failure.
|
|
# @param [string] hy_max_retries Set the number of retries to perform on a
|
|
# server after a connection failure.
|
|
# @param [string] hy_timeout_http_request Set the maximum allowed time to wait
|
|
# for a complete HTTP request.
|
|
# @param [string] hy_timeout_queue Set the maximum time to wait in the queue
|
|
# for a connection slot to be free.
|
|
# @param [string] hy_timeout_connect Set the maximum time to wait for a
|
|
# connection attempt to a server to succeed.
|
|
# @param [string] hy_timeout_client Set the maximum inactivity time on the
|
|
# client side.
|
|
# @param [string] hy_timeout_server Set the maximum inactivity time on the
|
|
# server side.
|
|
# @param [string] hy_timeout_http_keep_alive set the timeout value for
|
|
# keeping https connections alive
|
|
# @param [string] hy_timeout_check set the timeout value for how long to check
|
|
# if the timeout has occured
|
|
###############################################################################
|
|
class cd_haproxy::params (
|
|
|
|
$pkg_ensure = 'latest',
|
|
$reqpackages = ['haproxy','httpd-tools'],
|
|
|
|
$hy_host_fqdn = undef,
|
|
|
|
# firewall
|
|
$hy_manage_fw = true,
|
|
$hy_fw_order_no = '50',
|
|
|
|
# fail2ban
|
|
$hy_manage_fail2ban = false,
|
|
|
|
# main config
|
|
$hy_http_port = '80',
|
|
$hy_https_port = '443',
|
|
$hy_chroot = '/var/lib/haproxy',
|
|
$hy_pid = '/var/run/haproxy.pid',
|
|
$hy_maxconn = '4000',
|
|
$hy_show_stats = false,
|
|
$hy_stats_socket = '/var/lib/haproxy/stats',
|
|
$hy_default_mode = 'tcp',
|
|
$hy_use_http_server_close = false,
|
|
$hy_use_forward_for = false,
|
|
$hy_use_redispatch = true,
|
|
$hy_max_retries = '3',
|
|
$hy_timeout_http_request = '10s',
|
|
$hy_timeout_queue = '1m',
|
|
$hy_timeout_connect = '10s',
|
|
$hy_timeout_client = '1m',
|
|
$hy_timeout_server = '1m',
|
|
$hy_timeout_http_keep_alive = '10s',
|
|
$hy_timeout_check = '10s',
|
|
$hy_hard_stop = true,
|
|
$hy_hard_stop_value = '60s',
|
|
|
|
# user
|
|
$hy_user_name = 'haproxy',
|
|
$hy_user_comment = 'haproxy user',
|
|
$hy_user_home = '/var/lib/haproxy',
|
|
$hy_user_shell = '/sbin/nologin',
|
|
|
|
# logging
|
|
$hy_log_local0 = '127.0.0.1:514 local0',
|
|
$hy_log_local1 = '127.0.0.1:514 local1 notice',
|
|
$hy_log_target = '127.0.0.1',
|
|
$hy_log_facility = 'local2',
|
|
$hy_log_default = 'global',
|
|
$hy_use_tcplog = true,
|
|
$hy_use_httplog = false,
|
|
$hy_use_dontlognull = true,
|
|
|
|
|
|
) {
|
|
|
|
# service
|
|
$hy_service = 'haproxy'
|
|
|
|
# directories
|
|
$hy_main_dir = '/etc/haproxy'
|
|
$hy_errors_dir = "${hy_main_dir}/errors"
|
|
|
|
# files
|
|
$hy_main_config = "${hy_main_dir}/haproxy.cfg"
|
|
$hy_config_head_erb = 'cd_haproxy/haproxy_head.erb'
|
|
$hy_config_tail_erb = 'cd_haproxy/haproxy_tail.erb'
|
|
$hy_400_file = "${hy_errors_dir}/400.http"
|
|
$hy_400_erb = 'cd_haproxy/errors/400_http.erb'
|
|
$hy_403_file = "${hy_errors_dir}/403.http"
|
|
$hy_403_erb = 'cd_haproxy/errors/403_http.erb'
|
|
$hy_408_file = "${hy_errors_dir}/408.http"
|
|
$hy_408_erb = 'cd_haproxy/errors/408_http.erb'
|
|
$hy_500_file = "${hy_errors_dir}/500.http"
|
|
$hy_500_erb = 'cd_haproxy/errors/500_http.erb'
|
|
$hy_502_file = "${hy_errors_dir}/502.http"
|
|
$hy_502_erb = 'cd_haproxy/errors/502_http.erb'
|
|
$hy_503_file = "${hy_errors_dir}/503.http"
|
|
$hy_503_erb = 'cd_haproxy/errors/503_http.erb'
|
|
$hy_504_file = "${hy_errors_dir}/504.http"
|
|
$hy_504_erb = 'cd_haproxy/errors/504_http.erb'
|
|
|
|
# includes must be last
|
|
|
|
include cd_haproxy::main::config
|
|
|
|
}
|