adds templates
This commit is contained in:
@@ -20,30 +20,31 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# @summary Class holds all parameters for the cd_haproxy module and is
|
# @summary Class holds all parameters for the cd_haproxy module and is
|
||||||
# inherited by all classes except defines.
|
# inherited by all classes except defines.
|
||||||
# @param [string] pkg_ensure
|
# @param [string] pkg_ensure
|
||||||
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
||||||
# to choose, i.e. `latest` or `present`.
|
# to choose, i.e. `latest` or `present`.
|
||||||
# @param [string] reqpackages specify th epackages to be installed
|
# @param [string] reqpackages specify th epackages to be installed
|
||||||
# @param [string] hy_host_fqdn the fqdn of the ha proxy host. mmust be fqdn,
|
# @param [string] hy_host_fqdn the fqdn of the ha proxy host. mmust be fqdn,
|
||||||
# not cname. specify multiple fqdns via array.
|
# not cname. specify multiple fqdns via array.
|
||||||
# @param [boolean] hy_manage_fw whether to manage the firewall.
|
# @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
|
# @param [string] hy_fw_order_no the rule number to control the oder of the
|
||||||
# firewall rules.
|
# firewall rules.
|
||||||
# @param [string] hy_http_port the http port. used in firewall settings
|
# @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_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_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_home the home directory for the haprxy 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_user_shell the shell for the haproxy user.
|
||||||
# @param [string] hy_log_target Where to send the logs for this haproxy.
|
# @param [string] hy_log_target Where to send the logs for this haproxy.
|
||||||
# Currently only local logging / rsyslog forwarding supported.
|
# Currently only local logging / rsyslog forwarding supported.
|
||||||
# @param [string] hy_log_facility which logging facility to use.
|
# @param [string] hy_log_facility which logging facility to use.
|
||||||
# @param [string] hy_chroot where the chroot should be
|
# @param [string] hy_chroot where the chroot should be
|
||||||
# @param [string] hy_pid the pid file to use.
|
# @param [string] hy_pid the pid file to use.
|
||||||
# @param [string] hy_maxconn how many connections should we max allow.
|
# @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 [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_stats_socket name and path of the stats socket
|
||||||
|
# @param [string] hy_default_mode which mode to use in the defaults block
|
||||||
###############################################################################
|
###############################################################################
|
||||||
class cd_haproxy::params (
|
class cd_haproxy::params (
|
||||||
|
|
||||||
@@ -59,6 +60,12 @@ $hy_fw_order_no = '50',
|
|||||||
# main config
|
# main config
|
||||||
$hy_http_port = '80',
|
$hy_http_port = '80',
|
||||||
$hy_https_port = '443',
|
$hy_https_port = '443',
|
||||||
|
$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',
|
||||||
|
$hy_default_mode = 'http',
|
||||||
|
|
||||||
# user
|
# user
|
||||||
$hy_user_name = 'haproxy',
|
$hy_user_name = 'haproxy',
|
||||||
@@ -69,11 +76,6 @@ $hy_user_shell = '/sbin/nologin',
|
|||||||
# logging
|
# logging
|
||||||
$hy_log_target = '127.0.0.1',
|
$hy_log_target = '127.0.0.1',
|
||||||
$hy_log_facility = 'local2',
|
$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',
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,3 @@
|
|||||||
#---------------------------------------------------------------------
|
|
||||||
# Example configuration for a possible web application. See the
|
|
||||||
# full configuration options online.
|
|
||||||
#
|
|
||||||
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
|
|
||||||
#
|
|
||||||
#---------------------------------------------------------------------
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
|
||||||
# Global settings
|
|
||||||
#---------------------------------------------------------------------
|
|
||||||
global
|
|
||||||
# to have these messages end up in /var/log/haproxy.log you will
|
|
||||||
# need to:
|
|
||||||
#
|
|
||||||
# 1) configure syslog to accept network log events. This is done
|
|
||||||
# by adding the '-r' option to the SYSLOGD_OPTIONS in
|
|
||||||
# /etc/sysconfig/syslog
|
|
||||||
#
|
|
||||||
# 2) configure local2 events to go to the /var/log/haproxy.log
|
|
||||||
# file. A line like the following can be added to
|
|
||||||
# /etc/sysconfig/syslog
|
|
||||||
#
|
|
||||||
# local2.* /var/log/haproxy.log
|
|
||||||
#
|
|
||||||
log 127.0.0.1 local2
|
|
||||||
|
|
||||||
chroot /var/lib/haproxy
|
|
||||||
pidfile /var/run/haproxy.pid
|
|
||||||
maxconn 4000
|
|
||||||
user haproxy
|
|
||||||
group haproxy
|
|
||||||
daemon
|
|
||||||
|
|
||||||
# turn on stats unix socket
|
|
||||||
stats socket /var/lib/haproxy/stats
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# common defaults that all the 'listen' and 'backend' sections will
|
# common defaults that all the 'listen' and 'backend' sections will
|
||||||
# use if not designated in their block
|
# use if not designated in their block
|
||||||
|
|||||||
@@ -17,3 +17,21 @@ global
|
|||||||
<% if @hy_show_stats == true -%>
|
<% if @hy_show_stats == true -%>
|
||||||
stats socket <%= @hy_stats_socket %>
|
stats socket <%= @hy_stats_socket %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
defaults
|
||||||
|
mode http
|
||||||
|
log global
|
||||||
|
option httplog
|
||||||
|
option dontlognull
|
||||||
|
option http-server-close
|
||||||
|
option forwardfor except 127.0.0.0/8
|
||||||
|
option redispatch
|
||||||
|
retries 3
|
||||||
|
timeout http-request 10s
|
||||||
|
timeout queue 1m
|
||||||
|
timeout connect 10s
|
||||||
|
timeout client 1m
|
||||||
|
timeout server 1m
|
||||||
|
timeout http-keep-alive 10s
|
||||||
|
timeout check 10s
|
||||||
|
maxconn 3000
|
||||||
|
|||||||
Reference in New Issue
Block a user