init.sls 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # DHCP server (for gateways)
  3. #
  4. include:
  5. - network.interfaces
  6. isc-dhcp-server:
  7. pkg.installed:
  8. - name: isc-dhcp-server
  9. service.running:
  10. - enable: True
  11. - restart: True
  12. - require:
  13. - file: /etc/network/interfaces
  14. /etc/dhcp/dhcpd.conf:
  15. file.managed:
  16. - source: salt://dhcp-server/dhcpd.conf
  17. - template: jinja
  18. - watch_in:
  19. - service: isc-dhcp-server
  20. /etc/default/isc-dhcp-server:
  21. file.managed:
  22. - source: salt://dhcp-server/dhcpd.default
  23. - watch_in:
  24. - service: isc-dhcp-server
  25. #
  26. # Install dhcpd-pool monitoring magic from
  27. # http://folk.uio.no/trondham/software/dhcpd-pool.html
  28. /usr/local/sbin/dhcpd-pool:
  29. file.managed:
  30. - source: salt://dhcp-server/dhcpd-pool
  31. - mode: 755
  32. - user: root
  33. - group: root
  34. # There's a man page. Be nice, install it.
  35. /usr/local/share/man/man1/dhcpd-pool.1.gz:
  36. file.managed:
  37. - source: salt://dhcp-server/dhcpd-pool.1.gz
  38. - makedirs: true