init.sls 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  39. #
  40. # TODO: Wait for Icinga2
  41. #
  42. ## Install Nagios check while at it
  43. #/etc/nagios/nrpe.d/dhcpd-pool.cfg:
  44. # file.managed:
  45. # - source: salt://dhcp-server/dhcpd-pool.nrpe.cfg
  46. #
  47. ## dhcpd-pool should be run as root to avoid file righs issues
  48. ## when manually invoked by root
  49. #/etc/sudoers.d/dhcpd-pool:
  50. # file.managed:
  51. # - source: salt://dhcp-server/dhcpd-pool.sudoers
  52. # - mode: 0440