From cbcb50ad843df2d3b1c04b43b8daca1e4f724844 Mon Sep 17 00:00:00 2001 From: hoonetorg Date: Thu, 7 Apr 2016 21:17:37 +0200 Subject: [PATCH] allow to set arbitrary log options in global --- haproxy/templates/haproxy.jinja | 6 ++++++ pillar.example | 3 +++ 2 files changed, 9 insertions(+) diff --git a/haproxy/templates/haproxy.jinja b/haproxy/templates/haproxy.jinja index adb6d52..6f5a2bc 100644 --- a/haproxy/templates/haproxy.jinja +++ b/haproxy/templates/haproxy.jinja @@ -23,8 +23,14 @@ # Global settings #------------------ global +{%- if salt['pillar.get']('haproxy:global:log', []) != [] %} +{%- for log in salt['pillar.get']('haproxy:global:log') %} + log {{log}} +{%- endfor %} +{%- else %} log /dev/log local0 log /dev/log local1 notice +{%- endif %} user {{ salt['pillar.get']('haproxy:global:user', 'haproxy') }} group {{ salt['pillar.get']('haproxy:global:group', 'haproxy') }} {%- if salt['pillar.get']('haproxy:global:chroot:enable', 'no') == True %} diff --git a/pillar.example b/pillar.example index 28222f7..2fcc7cd 100644 --- a/pillar.example +++ b/pillar.example @@ -6,6 +6,9 @@ haproxy: enabled: True config_file_path: /etc/haproxy/haproxy.cfg global: + log: + - 127.0.0.1 local2 + - 127.0.0.1 local1 notice stats: enable: True socketpath: /var/lib/haproxy/stats