Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 1 | {%- from "isc_dhcp/map.jinja" import server with context %} |
Ales Komarek | 96e3c2f | 2014-09-21 17:53:15 +0200 | [diff] [blame] | 2 | {%- if server.enabled %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 3 | |
Ales Komarek | 96e3c2f | 2014-09-21 17:53:15 +0200 | [diff] [blame] | 4 | {%- if server.omapi_port is defined %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 5 | omapi-port {{ server.omapi_port }}; |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 6 | |
jan kaufman | 15c39d4 | 2016-02-15 15:56:57 +0100 | [diff] [blame] | 7 | {%- if server.omapi_key is defined %} |
jan kaufman | 90c6114 | 2016-02-15 15:43:32 +0100 | [diff] [blame] | 8 | key omapi_key { |
| 9 | algorithm HMAC-MD5; |
| 10 | secret "{{ server.omapi_key }}"; |
| 11 | }; |
| 12 | omapi-key omapi_key; |
jan kaufman | ac14171 | 2016-02-16 12:20:05 +0100 | [diff] [blame] | 13 | {% endif %} |
jan kaufman | 15c39d4 | 2016-02-15 15:56:57 +0100 | [diff] [blame] | 14 | {%- endif %} |
jan kaufman | 90c6114 | 2016-02-15 15:43:32 +0100 | [diff] [blame] | 15 | |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 16 | {%- if server.ddns_updates is defined %} |
| 17 | |
| 18 | ddns-updates on; |
| 19 | ddns-update-style interim; |
| 20 | |
| 21 | update-static-leases on; |
| 22 | use-host-decl-names on; |
| 23 | |
| 24 | {# |
| 25 | # Key from bind |
| 26 | include "<%= @dnsupdatekey %>"; |
| 27 | <% @dnsdomain.each do |dom| -%> |
| 28 | zone <%= dom %>. { |
| 29 | primary <%= @nameservers.first %>; |
| 30 | key <%= @dnskeyname%>; |
| 31 | } |
| 32 | #} |
| 33 | |
| 34 | {%- else -%} |
| 35 | |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 36 | ddns-update-style {{ server.ddns_update_style|default('none') }}; |
| 37 | |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 38 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 39 | |
| 40 | {%- if server.update_static_leases is defined %} |
| 41 | update-static-leases {{ server.update_static_leases }}; |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 42 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 43 | |
| 44 | {%- if server.use_host_decl_names is defined %} |
| 45 | use-host-decl-names {{ server.use_host_decl_names }}; |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 46 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 47 | |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 48 | {%- for zone_name, zone in server.zone.iteritems() %} |
| 49 | |
| 50 | zone {{ zone_name }} { |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 51 | primary {{ zone.primary }}; |
| 52 | {%- if 'key' in zone %} |
| 53 | key {{ zone.key|default('rndc-key') }}; |
| 54 | {%- endif %} |
| 55 | } |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 56 | |
| 57 | {%- endfor %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 58 | |
| 59 | default-lease-time {{ server.default_lease_time|default('600') }}; |
| 60 | max-lease-time {{ server.max_lease_time|default('7200') }}; |
| 61 | |
| 62 | {%- if server.authoritative|default(False) %} |
| 63 | authoritative; |
| 64 | {%- endif %} |
| 65 | |
| 66 | log-facility {{ server.logging.facility|default('local7') }}; |
| 67 | |
| 68 | {%- if server.next_server is defined -%} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 69 | next-server {{ server.next_server }}; |
Ales Komarek | 5858c81 | 2014-09-21 17:58:20 +0200 | [diff] [blame] | 70 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 71 | |
| 72 | {%- if server.filename is defined %} |
| 73 | filename "{{ server.filename }}"; |
Ales Komarek | 5858c81 | 2014-09-21 17:58:20 +0200 | [diff] [blame] | 74 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 75 | |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 76 | option domain-name "{{ server.domain_name }}"; |
jan kaufman | bba61ce | 2016-03-08 18:37:22 +0100 | [diff] [blame] | 77 | {%- if server.name_servers is defined %} |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 78 | option domain-name-servers {{ server.name_servers|join( ', ') }}; |
jan kaufman | bba61ce | 2016-03-08 18:37:22 +0100 | [diff] [blame] | 79 | {%- endif %} |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 80 | allow booting; |
| 81 | allow bootp; |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 82 | |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 83 | option fqdn.no-client-update on; # set the "O" and "S" flag bits |
| 84 | option fqdn.rcode2 255; |
| 85 | option pxegrub code 150 = text ; |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 86 | |
jan kaufman | a4274e8 | 2016-02-16 13:06:52 +0100 | [diff] [blame] | 87 | {%- if server.pxeserver is defined %} |
| 88 | next-server {{ server.pxeserver }}; |
| 89 | {%- endif %} |
Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame] | 90 | |
Ales Komarek | 474b7c3 | 2014-09-21 17:54:11 +0200 | [diff] [blame] | 91 | include "{{ server.config_dir }}/dhcpd.hosts"; |
Ales Komarek | 04bad39 | 2014-09-21 18:02:42 +0200 | [diff] [blame] | 92 | include "{{ server.config_dir }}/dhcpd.subnets"; |
Ales Komarek | 6d9bc2c | 2014-09-21 17:25:05 +0200 | [diff] [blame] | 93 | |
jan kaufman | 90c6114 | 2016-02-15 15:43:32 +0100 | [diff] [blame] | 94 | {%- endif %} |