diff --git a/manifests/params.pp b/manifests/params.pp index 401596d..1d409a5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,6 +20,7 @@ # along with this program. If not, see . # @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`. @@ -45,6 +46,12 @@ # @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. ############################################################################### class cd_haproxy::params ( @@ -76,6 +83,9 @@ $hy_user_shell = '/sbin/nologin', # logging $hy_log_target = '127.0.0.1', $hy_log_facility = 'local2', +$hy_log_default = 'global', +$hy_use_httplog = true, +$hy_use_dontlognull = true, ) { diff --git a/manifests/server/proxy.pp b/manifests/server/proxy.pp index a5cee9b..f6c2059 100644 --- a/manifests/server/proxy.pp +++ b/manifests/server/proxy.pp @@ -24,4 +24,6 @@ define cd_haproxy::server::proxy ( ) { + + } diff --git a/templates/haproxy_head.erb b/templates/haproxy_head.erb index c29cc0e..27a5907 100644 --- a/templates/haproxy_head.erb +++ b/templates/haproxy_head.erb @@ -19,10 +19,16 @@ global <% end -%> defaults - mode http + mode <%= @hy_default_mode %> log global +<% if @hy_use_httplog == true -%> option httplog +<% end -%> +<% if @hy_use_dontlognull == true -%> option dontlognull +<% else -%> + no option dontlognull +<% end -%> option http-server-close option forwardfor except 127.0.0.0/8 option redispatch