add tail
This commit is contained in:
@@ -47,6 +47,15 @@ class cd_haproxy::main::files (
|
||||
order => '001',
|
||||
}
|
||||
|
||||
|
||||
# create the header
|
||||
concat::fragment { 'tail':
|
||||
target => $hy_main_config,
|
||||
content => template($hy_config_tail_erb),
|
||||
order => '100',
|
||||
}
|
||||
|
||||
|
||||
# pid file
|
||||
file { $hy_pid:
|
||||
ensure => file,
|
||||
|
||||
@@ -1,26 +1,6 @@
|
||||
## 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.
|
||||
# @see https://cbonte.github.io/haproxy-dconv/1.5/configuration.html
|
||||
# @param [string] pkg_ensure
|
||||
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
||||
# to choose, i.e. `latest` or `present`.
|
||||
@@ -132,6 +112,7 @@ $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"
|
||||
|
||||
@@ -49,6 +49,7 @@ define cd_haproxy::server::proxy (
|
||||
$hy_acl_rule = 'cd_haproxy/haproxy_acl_rule.erb'
|
||||
|
||||
|
||||
|
||||
# Ensure acl_rule_front and acl_rule_back are arrays
|
||||
$acl_rule_front_array = split($acl_rule_front, ';')
|
||||
$acl_rule_back_array = split($acl_rule_back, ';')
|
||||
@@ -71,4 +72,5 @@ define cd_haproxy::server::proxy (
|
||||
content => template($hy_backendrule),
|
||||
order => $backend_order,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
4
templates/haproxy_tail.erb
Normal file
4
templates/haproxy_tail.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
backend error_backend
|
||||
mode http
|
||||
errorfile 503 /etc/haproxy/errors/503.http
|
||||
Reference in New Issue
Block a user