init.sls 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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:
  23. - salt://dhcp-server/dhcpd.default.{{ grains.oscodename }}
  24. - salt://dhcp-server/dhcpd.default
  25. - template: jinja
  26. - watch_in:
  27. - service: isc-dhcp-server
  28. #
  29. # Install dhcpd-pool monitoring magic from
  30. # http://folk.uio.no/trondham/software/dhcpd-pool.html
  31. /usr/local/sbin/dhcpd-pool:
  32. file.managed:
  33. - source: salt://dhcp-server/dhcpd-pool
  34. - mode: 755
  35. - user: root
  36. - group: root
  37. # There's a man page. Be nice, install it.
  38. /usr/local/share/man/man1/dhcpd-pool.1.gz:
  39. file.managed:
  40. - source: salt://dhcp-server/dhcpd-pool.1.gz
  41. - makedirs: true