Skip to content

Commit 40c7ac8

Browse files
authored
Merge pull request #50 from hoonetorg/feature/modular_log
allow to set arbitrary log options in global
2 parents 1c29ef8 + cbcb50a commit 40c7ac8

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
@@ -7,6 +7,9 @@ haproxy:
77
overwrite: True # Overwrite an existing config file if present (default behaviour unless set to false)
88
config_file_path: /etc/haproxy/haproxy.cfg
99
global:
10+
log:
11+
- 127.0.0.1 local2
12+
- 127.0.0.1 local1 notice
1013
stats:
1114
enable: True
1215
socketpath: /var/lib/haproxy/stats

0 commit comments

Comments
 (0)