zen_dhcpd/templates/dhcpd_conf.j2
Chris Hammer 21dd4cbc34 0.1.6-DEV-20200214-22546
------------------------
    * ADD:
      - added support for statically assigned dhcp nodes
2020-02-14 02:25:52 -05:00

43 lines
1.5 KiB
Django/Jinja

#####################################################
# The Zen Garden Network #
# #
# Configuration : {{ dhcp_conf_file }} #
# Version : {{ dhcp_conf_version }}-{{ dhcp_conf_revision }} #
# #
# Chris H. <chris@thezengarden.net> #
#####################################################
ddns-update-style {{ dhcp_ddns_style }};
option domain-name "{{ dhcp_domain_name }}";
default-lease-time {{ dhcp_default_lease }};
max-lease-time {{ dhcp_max_lease }};
{% if dhcp_authoritive == 'True' %}
authoritative;
{% endif %}
subnet {{ dhcp_networks[dhcp_deploy_to].subnet }} netmask {{ dhcp_networks[dhcp_deploy_to].netmask }}
{
range {{ dhcp_networks[dhcp_deploy_to].range_from }} {{ dhcp_networks[dhcp_deploy_to].range_to }};
option routers {{ dhcp_networks[dhcp_deploy_to].router }};
option broadcast-address {{ dhcp_networks[dhcp_deploy_to].broadcast }};
option domain-name "{{ dhcp_domain_name }}";
option domain-name-servers {{ dhcp_networks[dhcp_deploy_to].dns }};
filename "{{ dhcp_pxeboot_file }}";
next-server {{ dhcp_networks[dhcp_deploy_to].pxeboot }};
### STATIC ASSIGNMENTS ###
{% for host in static_assignments %}
host {{ host }}
{
hardware ethernet {{ static_assignments[host]['mac_address'] }};
fixed-address {{ static_assignments[host]['ip_address'] }};
}
{% endfor %}
}