diff --git a/salt-pillar/dhcp/init.sls b/salt-pillar/dhcp/init.sls index 7ff906a..c5f6743 100644 --- a/salt-pillar/dhcp/init.sls +++ b/salt-pillar/dhcp/init.sls @@ -16,6 +16,7 @@ dhcp: end: 172.20.77.254 time: 30 max-time: 3600 + lower-max-time: 50 opts: host-opts: routers: pub-gw.pub diff --git a/salt/dhcp/dhcpd.conf b/salt/dhcp/dhcpd.conf index e594b79..153468a 100644 --- a/salt/dhcp/dhcpd.conf +++ b/salt/dhcp/dhcpd.conf @@ -8,6 +8,10 @@ subnet {{ subnet.split('/')[0] }} netmask {{ netmasks[subnet.split('/')[1]] }} { authoritative; default-lease-time {{ conf['time'] }}; max-lease-time {{ conf['max-time'] }}; + {%- if conf.get('lower-max-time') and conf.get('time') %} + min-lease-time {{ conf['time'] }}; + adaptive-lease-time-threshold {{ conf['lower-max-time'] }}; + {%- endif %} range {{ conf['start'] }} {{ conf['end'] }}; {%- for name, value in (conf.get('opts') or {}).items() %} option {{ name }} {{ value }};