Merge pull request #14 from zentralwerk/dhcp-adaptive-lease

c
This commit is contained in:
Astro 2016-12-16 00:34:17 +01:00 committed by GitHub
commit 9c6def3c00
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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 }};