|
@@ -1,7 +1,8 @@
|
|
|
+{%- set dhcp_prefixes = salt['pillar.get']("nodes:" ~ grains["id"] ~ ":dhcp:server:prefixes", []) -%}
|
|
|
#
|
|
|
# Gateway DHCP server configuration (Salt managed)
|
|
|
#
|
|
|
-{%- set dhcp_prefixes = salt['pillar.get']("nodes:" ~ grains["id"] ~ ":dhcp:server:prefixes", []) %}
|
|
|
+
|
|
|
# The ddns-updates-style parameter controls whether or not the server will
|
|
|
# attempt to do a DNS update when a lease is confirmed. We default to the
|
|
|
# behavior of the version 2 packages ('none', since DHCP v2 didn't
|
|
@@ -21,14 +22,16 @@ subnet {{ prefix["network"] }} netmask {{ prefix["netmask"] }} {
|
|
|
pool {
|
|
|
# monitor: 75% 90% Y {{ grains['nodename'] }}/{{ prefix["description"] }} DHCP pool
|
|
|
|
|
|
+ # Use our own IP as gateway for our clients
|
|
|
option routers {{ prefix["routers"] }};
|
|
|
-
|
|
|
- {%- if "ranges" in prefix %}
|
|
|
- {%- for range in prefix["ranges"] %}
|
|
|
+{% if "ranges" in prefix %}
|
|
|
+ # Range(s) of IPs to lease to clients
|
|
|
+{%- for range in prefix["ranges"] %}
|
|
|
range {{ range }};
|
|
|
- {%- endfor %}
|
|
|
- {%- endif %}
|
|
|
+{%- endfor %}
|
|
|
+{%- else %}
|
|
|
+ # No ranges defined, static leases only?
|
|
|
+{%- endif %}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
{% endfor %}
|