|
3 | 3 | # {{ line }} |
4 | 4 | {%- endfor %} |
5 | 5 | {%- endif %} |
6 | | -{{ intendation }}subnet {{ subnet }} netmask {{ config.netmask }} { |
| 6 | +{{ indentation }}subnet {{ subnet }} netmask {{ config.netmask }} { |
7 | 7 | {%- if 'use_host_decl_names' in config %} |
8 | | -{{ intendation }} use-host-decl-names {{ config.use_host_decl_names }}; |
| 8 | +{{ indentation }} use-host-decl-names {{ config.use_host_decl_names }}; |
9 | 9 | {%- endif %} |
10 | 10 | {%- if 'range' in config %} |
11 | 11 | {%- if 'dynamic_bootp' in config and config.dynamic_bootp %} |
12 | | -{{ intendation }} range dynamic-bootp {{ config.range[0] }} {{ config.range[1] }}; |
| 12 | +{{ indentation }} range dynamic-bootp {{ config.range[0] }} {{ config.range[1] }}; |
13 | 13 | {%- else %} |
14 | | -{{ intendation }} range {{ config.range[0] }} {{ config.range[1] }}; |
| 14 | +{{ indentation }} range {{ config.range[0] }} {{ config.range[1] }}; |
15 | 15 | {%- endif %} |
16 | 16 | {%- endif %} |
17 | 17 | {%- if 'broadcast_address' in config %} |
18 | | -{{ intendation }} option broadcast-address {{ config['broadcast_address'] }}; |
| 18 | +{{ indentation }} option broadcast-address {{ config['broadcast_address'] }}; |
19 | 19 | {%- endif %} |
20 | 20 | {%- if 'domain_name_servers' in config %} |
21 | | -{{ intendation }} option domain-name-servers {{ config['domain_name_servers']|join(',') }}; |
| 21 | +{{ indentation }} option domain-name-servers {{ config['domain_name_servers']|join(',') }}; |
22 | 22 | {%- endif %} |
23 | 23 | {%- if 'netbios_name_servers' in config %} |
24 | | -{{ intendation }} option netbios-name-servers {{ config['netbios_name_servers']|join(',') }}; |
| 24 | +{{ indentation }} option netbios-name-servers {{ config['netbios_name_servers']|join(',') }}; |
25 | 25 | {%- endif %} |
26 | 26 | {%- if 'ntp_servers' in config %} |
27 | | -{{ intendation }} option ntp-servers {{ config['ntp_servers']|join(',') }}; |
| 27 | +{{ indentation }} option ntp-servers {{ config['ntp_servers']|join(',') }}; |
28 | 28 | {%- endif %} |
29 | 29 | {%- if 'lpr_servers' in config %} |
30 | | -{{ intendation }} option lpr-servers {{ config['lpr_servers']|join(',') }}; |
| 30 | +{{ indentation }} option lpr-servers {{ config['lpr_servers']|join(',') }}; |
31 | 31 | {%- endif %} |
32 | 32 | {%- if 'irc_server' in config %} |
33 | | -{{ intendation }} option irc-server {{ config['irc_server']|join(',') }}; |
| 33 | +{{ indentation }} option irc-server {{ config['irc_server']|join(',') }}; |
34 | 34 | {%- endif %} |
35 | 35 | {%- if 'tftp_server_name' in config %} |
36 | | -{{ intendation }} option tftp-server-name "{{ config['tftp_server_name'] }}"; |
| 36 | +{{ indentation }} option tftp-server-name "{{ config['tftp_server_name'] }}"; |
37 | 37 | {%- endif %} |
38 | 38 | {%- if 'smtp_server' in config %} |
39 | | -{{ intendation }} option smtp-server {{ config['smtp_server'] }}; |
| 39 | +{{ indentation }} option smtp-server {{ config['smtp_server'] }}; |
40 | 40 | {%- endif %} |
41 | 41 | {%- if 'domain_name' in config %} |
42 | | -{{ intendation }} option domain-name "{{ config['domain_name'] }}"; |
| 42 | +{{ indentation }} option domain-name "{{ config['domain_name'] }}"; |
43 | 43 | {%- endif %} |
44 | 44 | {%- if 'domain_search' in config %} |
45 | | -{{ intendation }} option domain-search "{{ config['domain_search']|join('","') }}"; |
| 45 | +{{ indentation }} option domain-search "{{ config['domain_search']|join('","') }}"; |
46 | 46 | {%- endif %} |
47 | 47 | {%- if 'filename' in config %} |
48 | | -{{ intendation }} filename "{{ config['filename'] }}"; |
| 48 | +{{ indentation }} filename "{{ config['filename'] }}"; |
49 | 49 | {%- endif %} |
50 | 50 | {%- if 'next_server' in config %} |
51 | | -{{ intendation }} next-server {{ config['next_server'] }}; |
| 51 | +{{ indentation }} next-server {{ config['next_server'] }}; |
52 | 52 | {%- endif %} |
53 | 53 | {%- if 'default_lease_time' in config %} |
54 | | -{{ intendation }} default-lease-time {{ config['default_lease_time'] }}; |
| 54 | +{{ indentation }} default-lease-time {{ config['default_lease_time'] }}; |
55 | 55 | {%- endif %} |
56 | 56 | {%- if 'max_lease_time' in config %} |
57 | | -{{ intendation }} max-lease-time {{ config['max_lease_time'] }}; |
| 57 | +{{ indentation }} max-lease-time {{ config['max_lease_time'] }}; |
58 | 58 | {%- endif %} |
59 | 59 | {%- if 'routers' in config and config.routers is string %} |
60 | | -{{ intendation }} option routers {{ config.routers }}; |
| 60 | +{{ indentation }} option routers {{ config.routers }}; |
61 | 61 | {%- elif 'routers' in config and config.routers is sequence %} |
62 | | -{{ intendation }} option routers |
| 62 | +{{ indentation }} option routers |
63 | 63 | {%- for router in config.routers %} {{ router }} |
64 | 64 | {%- if not loop.last %},{% else %};{% endif %} |
65 | 65 | {%- endfor %} |
66 | 66 | {%- endif %} |
67 | 67 | {%- for option in customized.keys() %} |
68 | 68 | {%- if option in config %} |
69 | 69 | {%- if customized[option]['type'] in types_to_quote %} {% set quote = dquote %} {%- endif %} |
70 | | -{{ intendation }} option {{ option|replace('_', '-') }} {{ quote }}{{ config.get(option) }}{{ quote }}; |
| 70 | +{{ indentation }} option {{ option|replace('_', '-') }} {{ quote }}{{ config.get(option) }}{{ quote }}; |
71 | 71 | {%- endif %} |
72 | 72 | {%- endfor %} |
73 | 73 | {%- for pool in salt['pillar.get']('dhcpd:subnets:{0}:pools'.format(subnet), []) %} |
74 | | -{{ intendation }} pool { |
| 74 | +{{ indentation }} pool { |
75 | 75 | {%- if 'failover_peer' in pool %} |
76 | | -{{ intendation }} failover peer "{{ pool['failover_peer'] }}"; |
| 76 | +{{ indentation }} failover peer "{{ pool['failover_peer'] }}"; |
77 | 77 | {%- endif %} |
78 | 78 | {%- if 'max_lease_time' in pool %} |
79 | | -{{ intendation }} max-lease-time {{ pool.max_lease_time }}; |
| 79 | +{{ indentation }} max-lease-time {{ pool.max_lease_time }}; |
80 | 80 | {%- endif %} |
81 | 81 | {%- if 'range' in pool %} |
82 | | -{{ intendation }} range {{ pool.range[0] }} {{ pool.range[1] }}; |
| 82 | +{{ indentation }} range {{ pool.range[0] }} {{ pool.range[1] }}; |
83 | 83 | {%- endif %} |
84 | 84 | {%- if 'allow' in pool %} |
85 | | -{{ intendation }} allow {{ pool.allow }}; |
| 85 | +{{ indentation }} allow {{ pool.allow }}; |
86 | 86 | {%- elif 'deny' in pool %} |
87 | | -{{ intendation }} deny {{ pool.deny }}; |
| 87 | +{{ indentation }} deny {{ pool.deny }}; |
88 | 88 | {%- endif %} |
89 | | -{{ intendation }} } |
| 89 | +{{ indentation }} } |
90 | 90 | {%- endfor %} |
91 | | -{{ intendation }}} |
| 91 | +{%- for host, config in salt['pillar.get']('dhcpd:subnets:{0}:hosts'.format(subnet), {}).items() %} |
| 92 | +{%- include 'dhcpd/files/host.jinja' with context %} |
| 93 | +{%- endfor %} |
| 94 | +{{ indentation }}} |
0 commit comments