blob: 61419f78c52cb16631f5b2738f3afd0874164957 [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 }};
Ales Komarek63c2db52014-09-15 09:26:22 +02006
jan kaufman15c39d42016-02-15 15:56:57 +01007{%- if server.omapi_key is defined %}
jan kaufman90c61142016-02-15 15:43:32 +01008key omapi_key {
9 algorithm HMAC-MD5;
10 secret "{{ server.omapi_key }}";
11};
12omapi-key omapi_key;
jan kaufmanac141712016-02-16 12:20:05 +010013{% endif %}
jan kaufman15c39d42016-02-15 15:56:57 +010014{%- endif %}
jan kaufman90c61142016-02-15 15:43:32 +010015
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 }}";
jan kaufmanbba61ce2016-03-08 18:37:22 +010077{%- if server.name_servers is defined %}
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020078option domain-name-servers {{ server.name_servers|join( ', ') }};
jan kaufmanbba61ce2016-03-08 18:37:22 +010079{%- endif %}
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020080allow booting;
81allow bootp;
Ales Komarek63c2db52014-09-15 09:26:22 +020082
Ales Komarek6d9bc2c2014-09-21 17:25:05 +020083option fqdn.no-client-update on; # set the "O" and "S" flag bits
84option fqdn.rcode2 255;
85option pxegrub code 150 = text ;
Ales Komarek63c2db52014-09-15 09:26:22 +020086
jan kaufmana4274e82016-02-16 13:06:52 +010087{%- if server.pxeserver is defined %}
88next-server {{ server.pxeserver }};
89{%- endif %}
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
jan kaufman90c61142016-02-15 15:43:32 +010094{%- endif %}