blob: ec97e4c1700e5a0ec83ef63fe9c9cce3d97a2ff7 [file] [log] [blame]
Ales Komarek63c2db52014-09-15 09:26:22 +02001{%- from "isc_dhcp/map.jinja" import server with context %}
Ales Komarek96e3c2f2014-09-21 17:53:15 +02002{%- if server.enabled %}
Ales Komarek63c2db52014-09-15 09:26:22 +02003
Ales Komarek96e3c2f2014-09-21 17:53:15 +02004{%- if server.omapi_port is defined %}
Ales Komarek63c2db52014-09-15 09:26:22 +02005omapi-port {{ server.omapi_port }};
6{% endif -%}
7
Ales Komarek6d9bc2c2014-09-21 17:25:05 +02008{%- if server.ddns_updates is defined %}
9
10ddns-updates on;
11ddns-update-style interim;
12
13update-static-leases on;
14use-host-decl-names on;
15
16{#
17# Key from bind
18include "<%= @dnsupdatekey %>";
19<% @dnsdomain.each do |dom| -%>
20zone <%= dom %>. {
21 primary <%= @nameservers.first %>;
22 key <%= @dnskeyname%>;
23}
24#}
25
26{%- else -%}
27
Ales Komarek63c2db52014-09-15 09:26:22 +020028ddns-update-style {{ server.ddns_update_style|default('none') }};
29
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020030{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020031
32{%- if server.update_static_leases is defined %}
33update-static-leases {{ server.update_static_leases }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020034{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020035
36{%- if server.use_host_decl_names is defined %}
37use-host-decl-names {{ server.use_host_decl_names }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020038{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020039
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020040{%- for zone_name, zone in server.zone.iteritems() %}
41
42zone {{ zone_name }} {
Ales Komarek63c2db52014-09-15 09:26:22 +020043 primary {{ zone.primary }};
44 {%- if 'key' in zone %}
45 key {{ zone.key|default('rndc-key') }};
46 {%- endif %}
47}
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020048
49{%- endfor %}
Ales Komarek63c2db52014-09-15 09:26:22 +020050
51default-lease-time {{ server.default_lease_time|default('600') }};
52max-lease-time {{ server.max_lease_time|default('7200') }};
53
54{%- if server.authoritative|default(False) %}
55authoritative;
56{%- endif %}
57
58log-facility {{ server.logging.facility|default('local7') }};
59
60{%- if server.next_server is defined -%}
Ales Komarek63c2db52014-09-15 09:26:22 +020061next-server {{ server.next_server }};
Ales Komarek5858c812014-09-21 17:58:20 +020062{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020063
64{%- if server.filename is defined %}
65filename "{{ server.filename }}";
Ales Komarek5858c812014-09-21 17:58:20 +020066{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020067
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020068option domain-name "{{ server.domain_name }}";
69option domain-name-servers {{ server.name_servers|join( ', ') }};
Ales Komarek63c2db52014-09-15 09:26:22 +020070
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020071allow booting;
72allow bootp;
Ales Komarek63c2db52014-09-15 09:26:22 +020073
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020074option fqdn.no-client-update on; # set the "O" and "S" flag bits
75option fqdn.rcode2 255;
76option pxegrub code 150 = text ;
Ales Komarek63c2db52014-09-15 09:26:22 +020077
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020078{#
Ales Komarek3162e352014-09-21 16:45:03 +020079
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020080<% if has_variable?( 'pxeserver' ) &&
81 has_variable?( 'pxefilename' ) &&
82 @pxeserver &&
83 @pxefilename -%>
84# PXE Handoff.
85next-server <%= @pxeserver %>;
86filename "<%= @pxefilename %>";
87<% end -%>
Ales Komarek63c2db52014-09-15 09:26:22 +020088
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020089#}
Ales Komarek63c2db52014-09-15 09:26:22 +020090
Ales Komarek474b7c32014-09-21 17:54:11 +020091include "{{ server.config_dir }}/dhcpd.hosts";
Ales Komarek04bad392014-09-21 18:02:42 +020092include "{{ server.config_dir }}/dhcpd.subnets";
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020093
Ales Komarek96e3c2f2014-09-21 17:53:15 +020094{%- endif %}