-
Notifications
You must be signed in to change notification settings - Fork 1
/
syslog.conf.j2
36 lines (35 loc) · 1.29 KB
/
syslog.conf.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# {{ ansible_managed }}
# This file controls the configuration of the syslog plugin.
# It simply takes events and writes them to syslog. The
# arguments provided can be the default priority that you
# want the events written with. And optionally, you can give
# a second argument indicating the facility that you want events
# logged to. Valid options are LOG_LOCAL0 through 7.
{% macro render_option(key,value,indent=false) %}
{% if value is defined %}
{% if indent == true %} {% endif %}
{% if value is sameas true %}
{{ key }} = yes
{% elif value is sameas false %}
{{ key }} = no
{% elif value is string or value is number %}
{{ key }} = {{ value }}
{% endif %}
{% endif %}
{% endmacro %}
{% macro body_option(key,override) %}
{% if override is defined %}
{% set value = override %}
{% elif syslog[key] is defined %}
{% set value = syslog[key] %}
{% elif syslog_defaults[key] is defined and syslog_skip_defaults != true %}
{% set value = syslog_defaults[key] %}
{% endif %}
{{ render_option(key,value) -}}
{% endmacro %}
{{ body_option("active",syslog_active) -}}
{{ body_option("args",syslog_args) -}}
{{ body_option("direction",syslog_direction) -}}
{{ body_option("format",syslog_format) -}}
{{ body_option("path",syslog_path) -}}
{{ body_option("type",syslog_type) -}}