init.sls 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # graylog
  3. #
  4. {% set graylog_config = salt['pillar.get']('logging:graylog') %}
  5. include:
  6. - mongodb
  7. - elasticsearch
  8. graylog-repo:
  9. # add Graylog Repo
  10. pkgrepo.managed:
  11. - humanname: Graylog Repo
  12. - name: deb https://packages.graylog2.org/repo/debian/ stable 4.2
  13. - file: /etc/apt/sources.list.d/graylog.list
  14. - key_url: https://packages.graylog2.org/repo/debian/keyring.gpg
  15. # install graylog
  16. graylog-server:
  17. pkg.installed:
  18. - pkgs:
  19. - graylog-server
  20. - graylog-enterprise-plugins
  21. - require:
  22. - pkgrepo: graylog-repo
  23. - service: mongodb
  24. - service: elasticsearch
  25. service.running:
  26. - enable: True
  27. - require:
  28. - pkg: graylog-server
  29. - file: /etc/graylog/server/server.conf
  30. - watch:
  31. - file: /etc/graylog/server/server.conf
  32. /etc/graylog/server/server.conf:
  33. file.managed:
  34. - source: salt://graylog/server.conf.tmpl
  35. - template: jinja
  36. - context:
  37. graylog_config: {{ graylog_config }}
  38. - require:
  39. - pkg: graylog-server
  40. # Install cronjob and notification script
  41. /etc/cron.d/graylog-system-notifications:
  42. file.managed:
  43. - source: salt://graylog/graylog-system-notifications.cron
  44. /usr/local/sbin/graylog-system-notifications:
  45. file.managed:
  46. - source: salt://graylog/graylog-system-notifications
  47. - mode: 700
  48. - template: jinja
  49. - context:
  50. graylog_config: {{ graylog_config }}