diff options
Diffstat (limited to 'src/lib/Server/Hostbase')
-rw-r--r-- | src/lib/Server/Hostbase/templates/dhcpd.tmpl | 2 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/hosts.tmpl | 4 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/hostsappend.tmpl | 24 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/named.tmpl | 21 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/reverseappend.tmpl | 16 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/reversesoa.tmpl | 21 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/templates/zone.tmpl | 29 |
7 files changed, 44 insertions, 73 deletions
diff --git a/src/lib/Server/Hostbase/templates/dhcpd.tmpl b/src/lib/Server/Hostbase/templates/dhcpd.tmpl index d4fd29447..309d5f961 100644 --- a/src/lib/Server/Hostbase/templates/dhcpd.tmpl +++ b/src/lib/Server/Hostbase/templates/dhcpd.tmpl @@ -3,7 +3,7 @@ # DO NOT EDIT IT BY HAND! # # This file contains {{ numips }} IP addresses -# Generated on: {{ timecreated }} +# Generated on: {% now "r" %} # {% include "dhcpd.conf.head" %} diff --git a/src/lib/Server/Hostbase/templates/hosts.tmpl b/src/lib/Server/Hostbase/templates/hosts.tmpl index e104333c9..4fded9d55 100644 --- a/src/lib/Server/Hostbase/templates/hosts.tmpl +++ b/src/lib/Server/Hostbase/templates/hosts.tmpl @@ -3,7 +3,7 @@ # # This file is generated automatically - DO NOT EDIT IT. # -# Generated on: {{ timecreated }} +# Generated on: {% now "r" %} # 127.0.0.1 localhost.mcs.anl.gov localhost @@ -22,5 +22,5 @@ {% for octet in three_octets_data %}{{ octet.0 }} {{ octet.1 }} {% endfor %} # -# Total host interfaces (ip addresses) in this file: {{ three_octets }} +# Total host interfaces (ip addresses) in this file: {{ num_ips }} diff --git a/src/lib/Server/Hostbase/templates/hostsappend.tmpl b/src/lib/Server/Hostbase/templates/hostsappend.tmpl index 0ebd67aee..00e0d5d04 100644 --- a/src/lib/Server/Hostbase/templates/hostsappend.tmpl +++ b/src/lib/Server/Hostbase/templates/hostsappend.tmpl @@ -1,19 +1,5 @@ -#raw########################################################################## -#end raw -# Hosts on subnet: ${subnet[0]} -# total hosts: ${subnet[1]} -#for $ip in $ips -${ip[0]} ${ip[1]} #slurp -#if $ip[4] and not $ip[3]: -# $ip[5] -#else -#for $name in $ip[2] -${name.split('.', 1)[0]} #slurp -#end for -#for $cname in $ip[3] -${cname.split('.', 1)[0]} #slurp -#end for -# $ip[5] -#end if -#end for - +########################################################################## +# Hosts on subnet: {{ subnet.0 }} +# total hosts: {{ subnet.1 }} +{% for ip in ips %}{{ ip.0 }} {{ ip.1 }}{% if ip.4 and not ip.3 %} # {{ ip.5 }}{% else %}{% for name in ip.2 %} {{ name }}{% endfor %}{% for cname in ip.3 %} {{ cname }}{% endfor %} # {{ ip.5 }}{% endif %} +{% endfor %} diff --git a/src/lib/Server/Hostbase/templates/named.tmpl b/src/lib/Server/Hostbase/templates/named.tmpl index 5b45e2158..7a227c04e 100644 --- a/src/lib/Server/Hostbase/templates/named.tmpl +++ b/src/lib/Server/Hostbase/templates/named.tmpl @@ -15,14 +15,12 @@ zone "." { // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 - -#for $zone in $zones -zone "${zone[1]}" { +{% for zone in zones %} +zone "{{ zone.1 }}" { type master; - file "/etc/bind/${zone[1]}"; -}; + file "/etc/bind/{{ zone.1 }}"; +};{% endfor %} -#end for zone "localhost" { type master; file "/etc/bind/db.local"; @@ -42,14 +40,11 @@ zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; }; - -#for $reverse in $reverses -zone "${reverse[0]}.in-addr.arpa" { +{% for reverse in reverses %} +zone "{{ reverse.0 }}.in-addr.arpa" { type master; - file "/etc/bind/${reverse[0]}.rev"; -}; - -#end for + file "/etc/bind/{{ reverse.0 }}.rev"; +};{% endfor %} // zone "com" { type delegation-only; }; // zone "net" { type delegation-only; }; diff --git a/src/lib/Server/Hostbase/templates/reverseappend.tmpl b/src/lib/Server/Hostbase/templates/reverseappend.tmpl index e4f667d37..64efe6e15 100644 --- a/src/lib/Server/Hostbase/templates/reverseappend.tmpl +++ b/src/lib/Server/Hostbase/templates/reverseappend.tmpl @@ -1,12 +1,4 @@ -#if $fileorigin != None -\$ORIGIN ${fileorigin}.in-addr.arpa. -#end if -\$ORIGIN ${inaddr}.in-addr.arpa. -#for $host in $hosts -#if $host[2] == 0 -${host[3][3]} PTR ${host[0]}. -#else -${host[3][3]} PTR ${host[4][0]}-${host[3][2]}.${host[4][1]}. -#end if -#end for - +{% if fileorigin %}$ORIGIN {{ fileorigin }}.in-addr.arpa.{% endif %} +$ORIGIN {{ inaddr }}.in-addr.arpa. +{% for host in hosts %}{% ifequal host.2 0 %}{{ host.3.3 }} PTR {{ host.0 }}.{% else %}{{ host.3.3 }} PTR {{ host.4.0 }}-{{ host.3.2 }}.{{ host.4.1 }}.{% endifequal %} +{% endfor %} diff --git a/src/lib/Server/Hostbase/templates/reversesoa.tmpl b/src/lib/Server/Hostbase/templates/reversesoa.tmpl index 0b775757f..d142eaf7f 100644 --- a/src/lib/Server/Hostbase/templates/reversesoa.tmpl +++ b/src/lib/Server/Hostbase/templates/reversesoa.tmpl @@ -1,14 +1,13 @@ -\$ORIGIN . -\$TTL $zone[8] -${inaddr}.in-addr.arpa IN SOA $zone[4]. $zone[3] ( - $zone[2] ; serial - $zone[7] ; refresh interval - $zone[6] ; retry interval - $zone[5] ; expire interval - $zone[8] ; min ttl +$ORIGIN . +$TTL {{ zone.8 }} +{{ inaddr }}.in-addr.arpa IN SOA {{ zone.4 }}. {{ zone.3 }} ( + {{ zone.2 }} ; serial + {{ zone.7 }} ; refresh interval + {{ zone.6 }} ; retry interval + {{ zone.5 }} ; expire interval + {{ zone.8 }} ; min ttl ) - #for $ns in $nameservers - NS $ns[0] - #end for + {% for ns in nameservers %}NS {{ ns.0 }} + {% endfor %} diff --git a/src/lib/Server/Hostbase/templates/zone.tmpl b/src/lib/Server/Hostbase/templates/zone.tmpl index 142d4dd77..aad48d179 100644 --- a/src/lib/Server/Hostbase/templates/zone.tmpl +++ b/src/lib/Server/Hostbase/templates/zone.tmpl @@ -1,19 +1,18 @@ $ORIGIN . $TTL {{ zone.8 }} -{{ zone.1 }}. IN SOA {{ zone.4 }}. {{ zone.3 }}. ( - {{ zone.2 }} ; serial - {{ zone.7 }} ; refresh interval - {{ zone.6 }} ; retry interval - {{ zone.5 }} ; expire interval - {{ zone.8 }} ; min ttl - ) - - {% for ns in nameservers %} - NS {{ ns.0 }}{% endfor %} - {% for a in addresses %} - A {{ a.0 }}{% endfor %} - {% for mx in mxs %} - MX {{ mx.0 }} {{ mx.1 }}{% endfor %} +{{ zone.1 }}. IN SOA {{ zone.4 }}. {{ zone.3 }}. ( + {{ zone.2 }} ; serial + {{ zone.7 }} ; refresh interval + {{ zone.6 }} ; retry interval + {{ zone.5 }} ; expire interval + {{ zone.8 }} ; min ttl + ) + {% for ns in nameservers %}NS {{ ns.0 }} + {% endfor %} + {% for a in addresses %}A {{ a.0 }} + {% endfor %} + {% for mx in mxs %}MX {{ mx.0 }} {{ mx.1 }} + {% endfor %} $ORIGIN {{ zone.1 }}. -localhost A 127.0.0.1 +localhost A 127.0.0.1 |