blob: 13375a60bbd886cafe2c15119c9a75e5b3f08bbf [file] [log] [blame]
Ales Komarek63c2db52014-09-15 09:26:22 +02001{%- from "isc_dhcp/map.jinja" import server with context %}
2
3{%- if server.omapi_port is defined -%}
4omapi-port {{ server.omapi_port }};
5{% endif -%}
6
Ales Komarek6d9bc2c2014-09-21 17:25:05 +02007{%- if server.ddns_updates is defined %}
8
9ddns-updates on;
10ddns-update-style interim;
11
12update-static-leases on;
13use-host-decl-names on;
14
15{#
16# Key from bind
17include "<%= @dnsupdatekey %>";
18<% @dnsdomain.each do |dom| -%>
19zone <%= dom %>. {
20 primary <%= @nameservers.first %>;
21 key <%= @dnskeyname%>;
22}
23#}
24
25{%- else -%}
26
Ales Komarek63c2db52014-09-15 09:26:22 +020027ddns-update-style {{ server.ddns_update_style|default('none') }};
28
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020029{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020030
31{%- if server.update_static_leases is defined %}
32update-static-leases {{ server.update_static_leases }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020033{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020034
35{%- if server.use_host_decl_names is defined %}
36use-host-decl-names {{ server.use_host_decl_names }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020037{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020038
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020039{%- for zone_name, zone in server.zone.iteritems() %}
40
41zone {{ zone_name }} {
Ales Komarek63c2db52014-09-15 09:26:22 +020042 primary {{ zone.primary }};
43 {%- if 'key' in zone %}
44 key {{ zone.key|default('rndc-key') }};
45 {%- endif %}
46}
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020047
48{%- endfor %}
Ales Komarek63c2db52014-09-15 09:26:22 +020049
50default-lease-time {{ server.default_lease_time|default('600') }};
51max-lease-time {{ server.max_lease_time|default('7200') }};
52
53{%- if server.authoritative|default(False) %}
54authoritative;
55{%- endif %}
56
57log-facility {{ server.logging.facility|default('local7') }};
58
59{%- if server.next_server is defined -%}
60{{ "\n" }}
61next-server {{ server.next_server }};
62{%- endif -%}
63
64{%- if server.filename is defined %}
65filename "{{ server.filename }}";
66{{- "\n" }}
67{%- endif -%}
68
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020069option domain-name "{{ server.domain_name }}";
70option domain-name-servers {{ server.name_servers|join( ', ') }};
Ales Komarek63c2db52014-09-15 09:26:22 +020071
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020072allow booting;
73allow bootp;
Ales Komarek63c2db52014-09-15 09:26:22 +020074
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020075option fqdn.no-client-update on; # set the "O" and "S" flag bits
76option fqdn.rcode2 255;
77option pxegrub code 150 = text ;
Ales Komarek63c2db52014-09-15 09:26:22 +020078
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020079{#
Ales Komarek3162e352014-09-21 16:45:03 +020080
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020081<% if has_variable?( 'pxeserver' ) &&
82 has_variable?( 'pxefilename' ) &&
83 @pxeserver &&
84 @pxefilename -%>
85# PXE Handoff.
86next-server <%= @pxeserver %>;
87filename "<%= @pxefilename %>";
88<% end -%>
Ales Komarek63c2db52014-09-15 09:26:22 +020089
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020090#}
Ales Komarek63c2db52014-09-15 09:26:22 +020091
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020092include "{{ server.config.dir }}/dhcpd.hosts";
93
94{%- endif -%}