bundles/dhcpd: rework metadata
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
3bd851aae5
commit
24362768fb
5 changed files with 17 additions and 38 deletions
|
@ -1,19 +1,21 @@
|
|||
#dhcpd.conf
|
||||
|
||||
<%
|
||||
import re
|
||||
import re
|
||||
from ipaddress import ip_network
|
||||
%>
|
||||
ddns-update-style none;
|
||||
|
||||
authoritative;
|
||||
|
||||
% for identifier, subnet in dhcp_config.get('subnets', {}).items():
|
||||
# subnet '${identifier}'
|
||||
subnet ${subnet['subnet']} netmask ${subnet['netmask']} {
|
||||
% for interface, subnet in sorted(dhcp_config.get('subnets', {}).items()):
|
||||
<%
|
||||
network = ip_network(subnet['subnet'])
|
||||
%>
|
||||
# interface ${interface} provides ${subnet['subnet']}
|
||||
subnet ${network.network_address} netmask ${network.netmask} {
|
||||
% if subnet.get('range_lower', None) and subnet.get('range_higher', None):
|
||||
range ${subnet['range_lower']} ${subnet['range_higher']};
|
||||
% endif
|
||||
interface "${subnet['interface']}";
|
||||
interface "${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()):
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
|
||||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
|
||||
INTERFACESv4="${listen_interfaces}"
|
||||
INTERFACESv4="${' '.join(sorted(node.metadata.get('dhcpd/subnets', {})))}"
|
||||
INTERFACESv6=""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue