bundlewrap/bundles/dhcpd/files/dhcpd.conf
Sophie Schiller cbfc8c75ad
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/dhcpd add defaults file and some escaping
2020-11-13 23:30:49 +01:00

34 lines
929 B
ISCdhcpd

#dhcpd.conf
<%
import re
%>
ddns-update-style none;
authoritative;
% for identfier, subnet in dhcp_config.get('subnets', {}).items():
subnet ${subnet['subnet']} netmask ${subnet['netmask']} {
% if subnet.get('range_lower', None) and subnet.get('range_higher', None):
range ${subnet['range_lower']} ${subnet['range_higher']};
% endif
interface "${subnet['interface']}";
default-lease-time ${subnet.get('default-lease-time', 600)};
max-lease-time ${subnet.get('max-lease-time', 3600)};
% for option, value in sorted(subnet.get('options', {}).items()):
% if re.match('([^0-9\.,\ ])', value):
option ${option} "${value}";
% else:
option ${option} ${value};
% endif
% endfor
}
% endfor
% for identifier, allocation in dhcp_config.get('fixed_allocations', {}).items():
host ${identifier} {
hardware ethernet ${allocation['mac']};
fixed-address ${allocation['ipv4']};
}
% endfor