Allow a user to specify the syslog address for HAProxy
authorYanis Guenane <yguenane@redhat.com>
Fri, 11 Sep 2015 13:06:08 +0000 (15:06 +0200)
committerYanis Guenane <yguenane@redhat.com>
Fri, 11 Sep 2015 13:16:49 +0000 (15:16 +0200)
Currently the address of the syslog server for HAProxy is hardcoded to
/dev/log without a way to customize this setting.

This commit aims to give a user more flexibility about which syslog
server address to use.

Change-Id: If7f7c8154e544e5d8a49f79f642e1ad01644a66d

manifests/loadbalancer.pp

index e30d76e..29c9d57 100644 (file)
 #  The value to use as maxconn in the haproxy default config section.
 #  Defaults to 4096
 #
+# [*haproxy_log_address*]
+#  The IPv4, IPv6 or filesystem socket path of the syslog server.
+#  Defaults to '/dev/log'
+#
 # [*controller_host*]
 #  (Deprecated)Host or group of hosts to load-balance the services
 #  Can be a string or an array.
@@ -246,6 +250,7 @@ class tripleo::loadbalancer (
   $haproxy_service_manage    = true,
   $haproxy_global_maxconn    = 20480,
   $haproxy_default_maxconn   = 4096,
+  $haproxy_log_address       = '/dev/log',
   $controller_host           = undef,
   $controller_hosts          = undef,
   $controller_hosts_names    = undef,
@@ -630,7 +635,7 @@ class tripleo::loadbalancer (
   class { '::haproxy':
     service_manage   => $haproxy_service_manage,
     global_options   => {
-      'log'     => '/dev/log local0',
+      'log'     => "${haproxy_log_address} local0",
       'pidfile' => '/var/run/haproxy.pid',
       'user'    => 'haproxy',
       'group'   => 'haproxy',