init.sls 1009 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # Postfix
  3. #
  4. # Force installation of bsd-mailx as it's not installed anymore in Debian Jessie..
  5. bsd-mailx:
  6. pkg.installed:
  7. - name: bsd-mailx
  8. postfix:
  9. pkg.installed:
  10. - name: postfix
  11. - requires:
  12. - file: /etc/mailname
  13. service.running:
  14. - enable: true
  15. - reload: true
  16. #
  17. # Don't listen on port 25, by default, a unix socket is enough.
  18. /etc/postfix/master.cf:
  19. file.managed:
  20. - source:
  21. - salt://postfix/master.cf.{{ grains['id'] }}
  22. - salt://postfix/master.cf.{{ grains['nodename'] }}
  23. - salt://postfix/master.cf.{{ grains.oscodename }}
  24. - salt://postfix/master.cf
  25. - watch_in:
  26. - service: postfix
  27. #
  28. # Send root mail to ops@ffho.net
  29. /etc/aliases:
  30. file.managed:
  31. - source: salt://postfix/aliases
  32. newaliases:
  33. cmd.wait:
  34. - name: /usr/bin/newaliases
  35. - watch:
  36. - file: /etc/aliases
  37. # Set mailname for xxx.paderborn.freifunk.net (FIXME)
  38. /etc/mailname:
  39. file.managed:
  40. - contents: "{{ grains.nodename }}.paderborn.freifunk.net"