Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions roles/dhcp/templates/dhcpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ subnet {{addr}} netmask {{n|ipaddr('netmask')}} {

{% if dhcp.networks is defined %}
{% for addr,net in dhcp.networks.iteritems() %}
{% if net.hosts is defined %}
{% for h in net.hosts %}
host {{net.vlan}}-{{h.name}} {
hardware ethernet {{h.mac}};
fixed-address {{h.ipv4}};
}
{% endfor %}
{% endif %}

subnet {{addr.split('/')[0]}} netmask {{addr|ipaddr('netmask')}} {
option routers {{net.default}};
Expand All @@ -69,6 +61,16 @@ subnet {{addr.split('/')[0]}} netmask {{addr|ipaddr('netmask')}} {
next-server {{net.pxe['next-server']}};
filename "{{net.pxe.filename}}";
{% endif %}

{% if net.hosts is defined %}
{% for h in net.hosts %}
host {{net.vlan}}-{{h.name}} {
hardware ethernet {{h.mac}};
fixed-address {{h.ipv4}};
}
{% endfor %}
{% endif %}

pool {
range {{net.range}};
}
Expand Down