Browse Source

Fix variable import

master
Nicolas Rodriguez 7 years ago
parent
commit
f3115d7019
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      syslog_ng/files/syslog-ng.conf

+ 7
- 7
syslog_ng/files/syslog-ng.conf View File

{%- from "syslog_ng/macro.jinja" import rule_builder -%} {%- from "syslog_ng/macro.jinja" import rule_builder -%}
{%- set syslog_config = pillar.get('syslog_ng', {}) -%}
{%- from "syslog_ng/map.jinja" import syslog_ng with context -%}


@version: {{ syslog_config.get('version', '3.3') }}
@version: {{ syslog_ng.get('version', '3.3') }}


{%- for module in syslog_config.get('module', []) %}
{%- for module in syslog_ng.get('module', []) %}
@module {{ rule_builder(module) }} @module {{ rule_builder(module) }}
{%- endfor %} {%- endfor %}


{%- for inc in syslog_config.get('include', []) %}
{%- for inc in syslog_ng.get('include', []) %}
@include {{ rule_builder(inc) }} @include {{ rule_builder(inc) }}
{%- endfor %} {%- endfor %}


options { options {
{%- for rule in syslog_config.get('options', []) %}
{%- for rule in syslog_ng.get('options', []) %}
{{ rule_builder(rule) }}; {{ rule_builder(rule) }};
{%- endfor %} {%- endfor %}
}; };


{%- for obj in ('source', 'destination', 'filter', 'parser', 'rewrite', 'template') %} {%- for obj in ('source', 'destination', 'filter', 'parser', 'rewrite', 'template') %}
{%- for params in syslog_config.get(obj, []) %}
{%- for params in syslog_ng.get(obj, []) %}
{% for name, rules in params.items() %} {% for name, rules in params.items() %}
{{ obj }} {{ name }} { {{ obj }} {{ name }} {
{%- for rule in rules %} {%- for rule in rules %}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}


{% for loggers in syslog_config.get('log', []) -%}
{% for loggers in syslog_ng.get('log', []) -%}
log { log {
{%- for rule in loggers %} {%- for rule in loggers %}
{{ rule_builder(rule) }}; {{ rule_builder(rule) }};

Loading…
Cancel
Save