init.sls 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # SNMPd
  3. #
  4. include:
  5. - network
  6. - systemd
  7. #
  8. # Install and start SNMPd
  9. # Require /etc/network/interfaces to be installed (and ifreload'ed) so we
  10. # can simply pick lookback IP addresses from grains.
  11. snmpd:
  12. pkg.installed:
  13. - name: snmpd
  14. - require:
  15. - file: /etc/network/interfaces
  16. service.running:
  17. - enable: true
  18. - reload: true
  19. # Add dependecy on network-online.target
  20. /etc/systemd/system/snmpd.service.d/override.conf:
  21. file.managed:
  22. - makedirs: true
  23. - source: salt://snmpd/service-override.conf
  24. - watch_in:
  25. - cmd: systemctl-daemon-reload
  26. /etc/default/snmpd:
  27. file.managed:
  28. - source: salt://snmpd/default_snmpd
  29. - require:
  30. - pkg: snmpd
  31. - watch_in:
  32. - service: snmpd
  33. /etc/snmp/snmpd.conf:
  34. file.managed:
  35. - template: jinja
  36. - source: salt://snmpd/snmpd.conf
  37. - require:
  38. - pkg: snmpd
  39. - watch_in:
  40. - service: snmpd