Saltstack Official Syslog-NG Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

48 lines
1.2KB

  1. ########################################################################
  2. # File managed by Salt at <{{ source }}>.
  3. # Your changes will be overwritten.
  4. ########################################################################
  5. {%- from "syslog_ng/macro.jinja" import rule_builder %}
  6. @version: {{ syslog_ng.get('version', '3.3') }}
  7. {%- for module in syslog_ng.get('module', []) %}
  8. @module {{ rule_builder(module) }}
  9. {%- endfor %}
  10. {%- for inc in syslog_ng.get('include', []) %}
  11. @include {{ rule_builder(inc) }}
  12. {%- endfor %}
  13. options {
  14. {%- for rule in syslog_ng.get('options', []) %}
  15. {{ rule_builder(rule) }};
  16. {%- endfor %}
  17. };
  18. {%- for obj in ('source', 'destination', 'filter', 'parser', 'rewrite', 'template') %}
  19. {%- for params in syslog_ng.get(obj, []) %}
  20. {% for name, rules in params.items() %}
  21. {{ obj }} {{ name }} {
  22. {%- for rule in rules %}
  23. {{ rule_builder(rule) }};
  24. {%- endfor %}
  25. };
  26. {%- endfor %}
  27. {%- endfor %}
  28. {%- endfor %}
  29. {% for loggers in syslog_ng.get('log', []) -%}
  30. log {
  31. {%- for rule in loggers %}
  32. {{ rule_builder(rule) }};
  33. {%- endfor %}
  34. };
  35. {% endfor %}
  36. {%- for inc in syslog_ng.get('last_include', []) %}
  37. @include {{ rule_builder(inc) }}
  38. {%- endfor %}