blob: ae90ac2e60f645bc35a732fc041d75285a477506 [file] [log] [blame]
{%- from "isc_dhcp/map.jinja" import server with context %}
{%- if server.enabled %}
{%- if server.omapi_port is defined %}
omapi-port {{ server.omapi_port }};
{%- if server.omapi_key is defined %}
key omapi_key {
algorithm HMAC-MD5;
secret "{{ server.omapi_key }}";
};
omapi-key omapi_key;
{%- endif %}
{%- endif %}
{%- if server.ddns_updates is defined %}
ddns-updates on;
ddns-update-style interim;
update-static-leases on;
use-host-decl-names on;
{#
# Key from bind
include "<%= @dnsupdatekey %>";
<% @dnsdomain.each do |dom| -%>
zone <%= dom %>. {
primary <%= @nameservers.first %>;
key <%= @dnskeyname%>;
}
#}
{%- else -%}
ddns-update-style {{ server.ddns_update_style|default('none') }};
{%- endif %}
{%- if server.update_static_leases is defined %}
update-static-leases {{ server.update_static_leases }};
{%- endif %}
{%- if server.use_host_decl_names is defined %}
use-host-decl-names {{ server.use_host_decl_names }};
{%- endif %}
{%- for zone_name, zone in server.zone.iteritems() %}
zone {{ zone_name }} {
primary {{ zone.primary }};
{%- if 'key' in zone %}
key {{ zone.key|default('rndc-key') }};
{%- endif %}
}
{%- endfor %}
default-lease-time {{ server.default_lease_time|default('600') }};
max-lease-time {{ server.max_lease_time|default('7200') }};
{%- if server.authoritative|default(False) %}
authoritative;
{%- endif %}
log-facility {{ server.logging.facility|default('local7') }};
{%- if server.next_server is defined -%}
next-server {{ server.next_server }};
{%- endif %}
{%- if server.filename is defined %}
filename "{{ server.filename }}";
{%- endif %}
option domain-name "{{ server.domain_name }}";
option domain-name-servers {{ server.name_servers|join( ', ') }};
allow booting;
allow bootp;
option fqdn.no-client-update on; # set the "O" and "S" flag bits
option fqdn.rcode2 255;
option pxegrub code 150 = text ;
{#
<% if has_variable?( 'pxeserver' ) &&
has_variable?( 'pxefilename' ) &&
@pxeserver &&
@pxefilename -%>
# PXE Handoff.
next-server <%= @pxeserver %>;
filename "<%= @pxefilename %>";
<% end -%>
#}
include "{{ server.config_dir }}/dhcpd.hosts";
include "{{ server.config_dir }}/dhcpd.subnets";
{%- endif %}