dhcpd.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {%- set dhcp_prefixes = salt['pillar.get']("nodes:" ~ grains["id"] ~ ":dhcp:server:prefixes", []) -%}
  2. #
  3. # Gateway DHCP server configuration (Salt managed)
  4. #
  5. # The ddns-updates-style parameter controls whether or not the server will
  6. # attempt to do a DNS update when a lease is confirmed. We default to the
  7. # behavior of the version 2 packages ('none', since DHCP v2 didn't
  8. # have support for DDNS.)
  9. ddns-update-style none;
  10. log-facility local7;
  11. default-lease-time 600;
  12. max-lease-time 3600;
  13. # Use Anycast DNS server(s)
  14. option domain-name-servers 10.132.251.53;
  15. {% for prefix in dhcp_prefixes %}
  16. # {{ prefix["description"] }}
  17. subnet {{ prefix["network"] }} netmask {{ prefix["netmask"] }} {
  18. pool {
  19. # monitor: 75% 90% Y {{ grains['nodename'] }}/{{ prefix["description"] }} DHCP pool
  20. # Use our own IP as gateway for our clients
  21. option routers {{ prefix["routers"] }};
  22. {% if "ranges" in prefix %}
  23. # Range(s) of IPs to lease to clients
  24. {%- for range in prefix["ranges"] %}
  25. range {{ range }};
  26. {%- endfor %}
  27. {%- else %}
  28. # No ranges defined, static leases only?
  29. {%- endif %}
  30. }
  31. }
  32. {% endfor %}