init.sls 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # Rsyslog configuration
  3. #
  4. {% set roles = salt['pillar.get'] ('nodes:' ~ grains['id'] ~ ':roles') %}
  5. rsyslog:
  6. pkg.installed:
  7. - name: rsyslog
  8. service.running:
  9. - enable: True
  10. /etc/rsyslog-early.d:
  11. file.directory:
  12. - user: root
  13. - group: root
  14. - mode: 0755
  15. /etc/rsyslog.conf:
  16. file.managed:
  17. - watch_in:
  18. - service: rsyslog
  19. {% if 'logserver' in roles %}
  20. - source: salt://rsyslog/rsyslog.conf.logserver
  21. {% else %}
  22. - source: salt://rsyslog/rsyslog.conf
  23. {% endif %}
  24. {% if 'logserver' in roles %}
  25. /etc/rsyslog.d/ffho.conf:
  26. file.managed:
  27. - source: salt://rsyslog/ffho.conf
  28. /etc/rsyslog.d/ffho:
  29. file.recurse:
  30. - source: salt://rsyslog/ffho
  31. - file_mode: 644
  32. - dir_mode: 755
  33. - user: root
  34. - group: root
  35. - clean: true
  36. - watch_in:
  37. - service: rsyslog
  38. /etc/logrotate.d/ffho:
  39. file.managed:
  40. - source: salt://rsyslog/ffho.logrotate
  41. {% endif %}