summaryrefslogtreecommitdiff
path: root/cfengine/cf.services.dhcp
blob: 695ebf055483eff7d1c7f367d922066ec3f5651c (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. BeginGroupIfFileExists "/etc/local-COMMON/dhcpd.conf.$(site)"
  21. BeginGroupIfFileIsNewer "/etc/local-COMMON/dhcpd.conf.$(site)"
  22. AutoCreate
  23. EmptyEntireFilePlease
  24. InsertFile "/etc/local-COMMON/dhcpd.conf.$(site)"
  25. Append "# Edited by cfengine $(date)"
  26. EndGroup
  27. DefineClasses "dhcpd_reload"
  28. EndGroup
  29. }
  30. processes:
  31. "dhcpd-2.2.x" restart "/etc/init.d/dhcp restart"
  32. shellcommands:
  33. dhcpd_reload::
  34. "/etc/init.d/dhcp force-reload"