Ales Komarek | 63c2db5 | 2014-09-15 09:26:22 +0200 | [diff] [blame^] | 1 | {%- from "isc_dhcp/map.jinja" import server with context %} |
| 2 | |
| 3 | {%- if server.omapi_port is defined -%} |
| 4 | omapi-port {{ server.omapi_port }}; |
| 5 | {% endif -%} |
| 6 | |
| 7 | ddns-update-style {{ server.ddns_update_style|default('none') }}; |
| 8 | |
| 9 | {%- if server.ddns_updates is defined %} |
| 10 | ddns-updates {{ server.ddns_updates }}; |
| 11 | {%- endif -%} |
| 12 | |
| 13 | {%- if server.update_static_leases is defined %} |
| 14 | update-static-leases {{ server.update_static_leases }}; |
| 15 | {%- endif -%} |
| 16 | |
| 17 | {%- if server.use_host_decl_names is defined %} |
| 18 | use-host-decl-names {{ server.use_host_decl_names }}; |
| 19 | {{- "\n" }} |
| 20 | {%- endif -%} |
| 21 | |
| 22 | {%- if server.zones is defined -%} |
| 23 | {%- for zone in server.dhcpd.zones|default({}) %} |
| 24 | zone {{ zone.name }} { |
| 25 | primary {{ zone.primary }}; |
| 26 | {%- if 'key' in zone %} |
| 27 | key {{ zone.key|default('rndc-key') }}; |
| 28 | {%- endif %} |
| 29 | } |
| 30 | {{- "\n" }} |
| 31 | {%- endfor -%} |
| 32 | {%- endif %} |
| 33 | |
| 34 | default-lease-time {{ server.default_lease_time|default('600') }}; |
| 35 | max-lease-time {{ server.max_lease_time|default('7200') }}; |
| 36 | |
| 37 | {%- if server.authoritative|default(False) %} |
| 38 | authoritative; |
| 39 | {%- endif %} |
| 40 | |
| 41 | log-facility {{ server.logging.facility|default('local7') }}; |
| 42 | |
| 43 | {%- if server.next_server is defined -%} |
| 44 | {{ "\n" }} |
| 45 | next-server {{ server.next_server }}; |
| 46 | {%- endif -%} |
| 47 | |
| 48 | {%- if server.filename is defined %} |
| 49 | filename "{{ server.filename }}"; |
| 50 | {{- "\n" }} |
| 51 | {%- endif -%} |
| 52 | |
| 53 | {%- if server.allow is defined -%} |
| 54 | {%- for a in server.dhcpd.allow|default([]) %} |
| 55 | allow {{ a }}; |
| 56 | {%- endfor -%} |
| 57 | {{ "\n" }} |
| 58 | {%- endif -%} |
| 59 | |
| 60 | {%- if server.deny is defined -%} |
| 61 | {%- for d in server.dhcpd.deny|default([]) %} |
| 62 | deny {{ d }}; |
| 63 | {%- endfor -%} |
| 64 | {{ "\n" }} |
| 65 | {%- endif -%} |
| 66 | |
| 67 | {%- if server.ignore is defined -%} |
| 68 | {%- for i in server.ignore|default([]) %} |
| 69 | ignore {{ i }}; |
| 70 | {%- endfor -%} |
| 71 | {{ "\n" }} |
| 72 | {%- endif -%} |
| 73 | |
| 74 | {%- set options = server.dhcpd.default_options|default([]) -%} |
| 75 | {%- if server.dhcpd.options is defined -%} |
| 76 | {%- do options.extend(server.dhcpd.options) -%} |
| 77 | {%- endif -%} |
| 78 | |
| 79 | {%- for o in options %} |
| 80 | option {{ o }}; |
| 81 | {%- endfor -%} |
| 82 | {%- set options = [] -%} |
| 83 | |
| 84 | {%- if server.default_includes is defined -%} |
| 85 | {%- set includes = server.dhcpd.default_includes -%} |
| 86 | {%- endif -%} |
| 87 | {%- if server.dhcpd.includes is defined -%} |
| 88 | {%- do includes.extend(server.dhcpd.includes) -%} |
| 89 | {%- endif -%} |
| 90 | {{ "\n" }} |
| 91 | |
| 92 | {%- for i in includes %} |
| 93 | include "{{ i }}"; |
| 94 | {%- endfor -%} |
| 95 | {%- set includes = [] -%} |
| 96 | |
| 97 | {%- if server.dhcpd.file_append is defined %} |
| 98 | |
| 99 | {{ server.dhcpd.file_append }} |
| 100 | |
| 101 | {%- endif -%} |
| 102 | |
| 103 | {%- endif -%} |