Skip to content

Commit cbcb50a

Browse files
author
hoonetorg
committed
allow to set arbitrary log options in global
1 parent 0d2b72c commit cbcb50a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

haproxy/templates/haproxy.jinja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
# Global settings
2424
#------------------
2525
global
26+
{%- if salt['pillar.get']('haproxy:global:log', []) != [] %}
27+
{%- for log in salt['pillar.get']('haproxy:global:log') %}
28+
log {{log}}
29+
{%- endfor %}
30+
{%- else %}
2631
log /dev/log local0
2732
log /dev/log local1 notice
33+
{%- endif %}
2834
user {{ salt['pillar.get']('haproxy:global:user', 'haproxy') }}
2935
group {{ salt['pillar.get']('haproxy:global:group', 'haproxy') }}
3036
{%- if salt['pillar.get']('haproxy:global:chroot:enable', 'no') == True %}

pillar.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ haproxy:
66
enabled: True
77
config_file_path: /etc/haproxy/haproxy.cfg
88
global:
9+
log:
10+
- 127.0.0.1 local2
11+
- 127.0.0.1 local1 notice
912
stats:
1013
enable: True
1114
socketpath: /var/lib/haproxy/stats

0 commit comments

Comments
 (0)