Files
confdroid_haproxy/manifests/params.pp

96 lines
3.6 KiB
ObjectPascal
Raw Normal View History

2018-04-24 15:32:11 +02:00
## cd_haproxy::params.pp
# Module name: cd_haproxy
# Author: Arne Teuke (arne_teuke@confdroid.com)
# License:
# This file is part of cd_haproxy.
#
# cd_haproxy is used for providing automatic configuration of HA proxy.
# Copyright (C) 2017 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 Class holds all parameters for the cd_haproxy module and is
# inherited by all classes except defines.
# @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.
2018-12-10 16:12:32 +01:00
# @param [string] hy_http_port the http port. used in firewall settings
2018-12-10 16:09:52 +01:00
# @param [string] hy_https_port the https port. used in firewall settings
2018-12-10 16:12:32 +01:00
# @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.
2018-12-10 16:57:53 +01:00
# @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
2018-12-10 16:12:32 +01:00
###############################################################################
2018-04-24 15:32:11 +02:00
class cd_haproxy::params (
$pkg_ensure = 'latest',
$reqpackages = ['haproxy'],
2018-04-24 15:32:11 +02:00
$hy_host_fqdn = "proxy.${::domain}",
2018-04-24 15:32:11 +02:00
# firewall
$hy_manage_fw = true,
$hy_fw_order_no = '50',
2018-04-24 15:32:11 +02:00
# main config
$hy_http_port = '80',
$hy_https_port = '443',
2018-12-10 14:36:54 +01:00
# user
$hy_user_name = 'haproxy',
$hy_user_comment = 'haproxy user',
$hy_user_home = '/var/lib/haproxy',
$hy_user_shell = '/sbin/nologin',
2018-04-24 15:32:11 +02:00
2018-12-10 16:57:53 +01:00
# 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',
2018-04-24 15:32:11 +02:00
) {
# service
$hy_service = 'haproxy'
2018-12-10 14:36:54 +01:00
# directories
$hy_main_dir = '/etc/haproxy'
2018-04-24 15:32:11 +02:00
2018-12-10 14:36:54 +01:00
# files
$hy_main_config = "${hy_main_dir}/haproxy.cfg"
2018-12-10 16:21:45 +01:00
$hy_config_head_erb = 'cd_haproxy/haproxy_head.erb'
2018-04-24 15:32:11 +02:00
# includes must be last
2018-04-24 17:07:38 +02:00
include cd_haproxy::main::config
2018-04-24 15:32:11 +02:00
}