adds options

This commit is contained in:
Arne Teuke
2018-12-19 16:07:59 +01:00
parent b1bd401033
commit 677ad69148
3 changed files with 19 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
# 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.
# @see https://cbonte.github.io/haproxy-dconv/1.5/configuration.html
# @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`.
@@ -45,6 +46,12 @@
# @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 # @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.
############################################################################### ###############################################################################
class cd_haproxy::params ( class cd_haproxy::params (
@@ -76,6 +83,9 @@ $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_log_default = 'global',
$hy_use_httplog = true,
$hy_use_dontlognull = true,
) { ) {

View File

@@ -24,4 +24,6 @@ define cd_haproxy::server::proxy (
) { ) {
} }

View File

@@ -19,10 +19,16 @@ global
<% end -%> <% end -%>
defaults defaults
mode http mode <%= @hy_default_mode %>
log global log global
<% if @hy_use_httplog == true -%>
option httplog option httplog
<% end -%>
<% if @hy_use_dontlognull == true -%>
option dontlognull option dontlognull
<% else -%>
no option dontlognull
<% end -%>
option http-server-close option http-server-close
option forwardfor except 127.0.0.0/8 option forwardfor except 127.0.0.0/8
option redispatch option redispatch