summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.dhcp
blob: a4e78d276598ae7044595da16632e8fc659bc920 (plain)
  1. control:
  2.     AddInstallable = ( dhcpd_reload )
  3. editfiles:
  4. { /etc/init.d/dhcp
  5. #
  6. # First of all, this is a DHCP server so let's make it possible
  7. # for DHCP to start.
  8. #
  9. LocateLineMatching "^run_dhcpd=.*"
  10. BeginGroupIfNoLineMatching '^run_dhcpd=1'
  11. ReplaceLineWith 'run_dhcpd=1'
  12. EndGroup
  13. DefineClasses "dhcpd_reload"
  14. }
  15. { /etc/dhcpd.conf
  16. #
  17. # We don't make the dhcp.conf dynamically, but instead we copy the contents
  18. # of a master file, but only if it's newer than the one installed.
  19. #
  20. BeginGroupIfFileIsNewer "/etc/local-COMMON/dhcpd.conf.$(site)"
  21. AutoCreate
  22. EmptyEntireFilePlease
  23. InsertFile "/etc/local-COMMON/dhcpd.conf.$(site)"
  24. Append "# Edited by cfengine $(date)"
  25. EndGroup
  26. DefineClasses "dhcpd_reload"
  27. }
  28. processes:
  29. "dhcpd-2.2.x" restart "/etc/init.d/dhcp restart"
  30. shellcommands:
  31. dhcpd_reload::
  32. "/etc/init.d/dhcp force-reload"