allow to set arbitrary log options in global

This commit is contained in:
hoonetorg 2016-04-07 21:17:37 +02:00
parent 0d2b72c138
commit cbcb50ad84
2 changed files with 9 additions and 0 deletions

View file

@ -23,8 +23,14 @@
# Global settings # Global settings
#------------------ #------------------
global 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 local0
log /dev/log local1 notice log /dev/log local1 notice
{%- endif %}
user {{ salt['pillar.get']('haproxy:global:user', 'haproxy') }} user {{ salt['pillar.get']('haproxy:global:user', 'haproxy') }}
group {{ salt['pillar.get']('haproxy:global:group', 'haproxy') }} group {{ salt['pillar.get']('haproxy:global:group', 'haproxy') }}
{%- if salt['pillar.get']('haproxy:global:chroot:enable', 'no') == True %} {%- if salt['pillar.get']('haproxy:global:chroot:enable', 'no') == True %}

View file

@ -6,6 +6,9 @@ haproxy:
enabled: True enabled: True
config_file_path: /etc/haproxy/haproxy.cfg config_file_path: /etc/haproxy/haproxy.cfg
global: global:
log:
- 127.0.0.1 local2
- 127.0.0.1 local1 notice
stats: stats:
enable: True enable: True
socketpath: /var/lib/haproxy/stats socketpath: /var/lib/haproxy/stats