Cookbooks
haproxy
documentation
Haproxy Config Global

Back To Resource List (opens in a new tab)


haproxy_config_global

Parameters in the "global" section are process-wide and often OS-specific.

They are generally set once for all and do not need being changed once correct.

Introduced: v4.0.0

Actions

  • :create

Properties

This resource also uses the following partial resources:

NameTypeDefaultDescriptionAllowed Values
pidfileString/var/run/haproxy.pidWrites PIDs of all daemons into file <pidfile>
logString, Array/dev/log syslog infoAdds a global syslog server
daemonTrueClass, FalseClasstrueMakes the process fork into background
debug_optionStringquietSets the debugging modequiet, debug
statsHash{socket: "/var/run/haproxy.sock user #{haproxy_user} group #{haproxy_group}",timeout: '2m'}Enable stats with various options
maxconnInteger4096Sets the maximum per-process number of concurrent connections
chrootStringNoneChanges current directory to <jail dir> and performs a chroot() there before dropping privileges
log_tagStringhaproxySpecifies the log tag to use for all outgoing logs
tuningHashNoneA hash of tune.<options>
extra_optionsHashNoneUsed for setting any HAProxy directives

Examples

haproxy_config_global '' do
  chroot '/var/lib/haproxy'
  daemon true
  maxconn 256
  log '/dev/log local0'
  log_tag 'WARDEN'
  pidfile '/var/run/haproxy.pid'
  stats socket: '/var/lib/haproxy/stats level admin'
  tuning 'bufsize' => '262144'
end
haproxy_config_global 'global' do
  daemon false
  maxconn 4097
  chroot '/var/lib/haproxy'
  stats socket: '/var/lib/haproxy/haproxy.stat mode 600 level admin',
        timeout: '2m'
end