Skip to content

Instantly share code, notes, and snippets.

@viq
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viq/afbd5fe1150cf2aa6879 to your computer and use it in GitHub Desktop.
Save viq/afbd5fe1150cf2aa6879 to your computer and use it in GitHub Desktop.
{% from "base/syslog/syslog.jinja" import syslog with context %}
include:
- base.example-ca
syslog-ng:
service:
- dead
- enable: False
rsyslog:
pkg:
- installed
- pkgs:
- rsyslog
- rsyslog-gnutls
service:
- running
- enable: True
- require:
- pkg: rsyslog
- service: syslog-ng
- watch:
- file: rsyslog
- sls: base.zwsa-ca
file.managed:
- name: /etc/rsyslog.conf
- source:
- salt://conf/syslog/rsyslog.conf.{{ grains['fqdn'] }}
- salt://conf/syslog/rsyslog.conf
- template: jinja
- context:
loghost: {{ syslog.loghost }}
- user: root
- group: root
- mode: 644
- require:
- pkg: rsyslog
{% if salt['network.in_subnet']('11.22.33.44/16') %}
{% set loghost = "{{ salt['dnsutil.A']('logger1.example.com')[0] }}" %}
{% else %}
{% set loghost = "{{ salt['dnsutil.A']('logger2.example.com')[0] }}" %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment