blob: 8cfe20571a72fd7966619107bd1d2261de027964 [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
jan kaufman90c61142016-02-15 15:43:32 +01008{- if server.omapi_key and server.omapi_port is defined %}
9key omapi_key {
10 algorithm HMAC-MD5;
11 secret "{{ server.omapi_key }}";
12};
13omapi-key omapi_key;
14{%- endif %}
15
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020016{%- if server.ddns_updates is defined %}
17
18ddns-updates on;
19ddns-update-style interim;
20
21update-static-leases on;
22use-host-decl-names on;
23
24{#
25# Key from bind
26include "<%= @dnsupdatekey %>";
27<% @dnsdomain.each do |dom| -%>
28zone <%= dom %>. {
29 primary <%= @nameservers.first %>;
30 key <%= @dnskeyname%>;
31}
32#}
33
34{%- else -%}
35
Ales Komarek63c2db52014-09-15 09:26:22 +020036ddns-update-style {{ server.ddns_update_style|default('none') }};
37
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020038{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020039
40{%- if server.update_static_leases is defined %}
41update-static-leases {{ server.update_static_leases }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020042{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020043
44{%- if server.use_host_decl_names is defined %}
45use-host-decl-names {{ server.use_host_decl_names }};
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020046{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020047
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020048{%- for zone_name, zone in server.zone.iteritems() %}
49
50zone {{ zone_name }} {
Ales Komarek63c2db52014-09-15 09:26:22 +020051 primary {{ zone.primary }};
52 {%- if 'key' in zone %}
53 key {{ zone.key|default('rndc-key') }};
54 {%- endif %}
55}
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020056
57{%- endfor %}
Ales Komarek63c2db52014-09-15 09:26:22 +020058
59default-lease-time {{ server.default_lease_time|default('600') }};
60max-lease-time {{ server.max_lease_time|default('7200') }};
61
62{%- if server.authoritative|default(False) %}
63authoritative;
64{%- endif %}
65
66log-facility {{ server.logging.facility|default('local7') }};
67
68{%- if server.next_server is defined -%}
Ales Komarek63c2db52014-09-15 09:26:22 +020069next-server {{ server.next_server }};
Ales Komarek5858c812014-09-21 17:58:20 +020070{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020071
72{%- if server.filename is defined %}
73filename "{{ server.filename }}";
Ales Komarek5858c812014-09-21 17:58:20 +020074{%- endif %}
Ales Komarek63c2db52014-09-15 09:26:22 +020075
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020076option domain-name "{{ server.domain_name }}";
77option domain-name-servers {{ server.name_servers|join( ', ') }};
Ales Komarek63c2db52014-09-15 09:26:22 +020078
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020079allow booting;
80allow bootp;
Ales Komarek63c2db52014-09-15 09:26:22 +020081
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020082option fqdn.no-client-update on; # set the "O" and "S" flag bits
83option fqdn.rcode2 255;
84option pxegrub code 150 = text ;
Ales Komarek63c2db52014-09-15 09:26:22 +020085
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020086{#
Ales Komarek3162e352014-09-21 16:45:03 +020087
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020088<% if has_variable?( 'pxeserver' ) &&
89 has_variable?( 'pxefilename' ) &&
90 @pxeserver &&
91 @pxefilename -%>
92# PXE Handoff.
93next-server <%= @pxeserver %>;
94filename "<%= @pxefilename %>";
95<% end -%>
Ales Komarek63c2db52014-09-15 09:26:22 +020096
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020097#}
Ales Komarek63c2db52014-09-15 09:26:22 +020098
Ales Komarek474b7c32014-09-21 17:54:11 +020099include "{{ server.config_dir }}/dhcpd.hosts";
Ales Komarek04bad392014-09-21 18:02:42 +0200100include "{{ server.config_dir }}/dhcpd.subnets";
Ales Komarek6d9bc2c2014-09-21 17:25:05 +0200101
jan kaufman90c61142016-02-15 15:43:32 +0100102{%- endif %}