Updated all templates to use instance variables

This commit is contained in:
Ossi Salmi 2013-05-05 00:07:55 +03:00
parent a0c854d3c0
commit dc51af1ca2
113 changed files with 527 additions and 522 deletions

View file

@ -2,4 +2,4 @@
RESOLVCONF=yes
# startup options for the server
OPTIONS="<% bind_startup_options %>"
OPTIONS="<% @bind_startup_options %>"

View file

@ -1,11 +1,11 @@
;
; BIND data file for <%= zone %>
; BIND data file for <%= @zone %>
;
;
$TTL 3600
$ORIGIN <%= zone %>.
<% master.each_pair do |k, v| %>
@ IN SOA <%= v['ns'] %>. <%= soacontact %>. (
$ORIGIN <%= @zone %>.
<% @master.each_pair do |k, v| %>
@ IN SOA <%= v['ns'] %>. <%= @soacontact %>. (
<%= Time.now.to_i %> ; Serial
3600 ; Refresh
7200 ; Retry
@ -14,15 +14,15 @@ $ORIGIN <%= zone %>.
;
@ IN NS <%= v['ns'] %>.
<% end -%>
<% if slaves != [] %>
<% slaves.each_pair do |k, v| -%>
<% if @slaves != [] %>
<% @slaves.each_pair do |k, v| -%>
@ IN NS <%= v['ns'] %>.
<% end -%>
<% end -%>
<% if zone.match(/\//) %>
$INCLUDE <%= zonedir %>/db.<%= zone.sub(/\//, '-') %>-dynamic
$INCLUDE <%= zonedir %>/db.<%= zone.sub(/\//, '-') %>-static
<% if @zone.match(/\//) %>
$INCLUDE <%= @zonedir %>/db.<%= @zone.sub(/\//, '-') %>-dynamic
$INCLUDE <%= @zonedir %>/db.<%= @zone.sub(/\//, '-') %>-static
<% else %>
$INCLUDE <%= zonedir %>/db.<%= zone %>-dynamic
$INCLUDE <%= zonedir %>/db.<%= zone %>-static
$INCLUDE <%= @zonedir %>/db.<%= @zone %>-dynamic
$INCLUDE <%= @zonedir %>/db.<%= @zone %>-static
<% end -%>

View file

@ -1,8 +1,8 @@
#!/bin/sh
chroot="<%= chroot %>"
confdir="<%= confdir %>"
operatingsystem="<%= operatingsystem %>"
chroot="<%= @chroot %>"
confdir="<%= @confdir %>"
operatingsystem="<%= @operatingsystem %>"
printview() {
view=$1

View file

@ -37,4 +37,4 @@
ROOTDIR=/var/named/chroot
# startup options for the server
OPTIONS="<% bind_startup_options %>"
OPTIONS="<% @bind_startup_options %>"

View file

@ -2,10 +2,10 @@
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DNSSERVER="<%= dns_nsupdate_server -%>"
DNSZONE="<% if has_variable?("dns_nsupdate_zone") -%><%= dns_nsupdate_zone -%><% end %>"
MYNAME="<%= dns_nsupdate_name -%>"
MYKEY="<%= dns_nsupdate_key -%>"
DNSSERVER="<%= @dns_nsupdate_server -%>"
DNSZONE="<% if @dns_nsupdate_zone -%><%= @dns_nsupdate_zone -%><% end %>"
MYNAME="<%= @dns_nsupdate_name -%>"
MYKEY="<%= @dns_nsupdate_key -%>"
# if zone is not defined take it from fqdn
if [ "${DNSZONE}" = "" ]; then

View file

@ -1,18 +1,18 @@
key "<%= zone %>" {
algorithm <%= keytype %>;
secret "<%= key %>";
key "<%= @zone %>" {
algorithm <%= @keytype %>;
secret "<%= @key %>";
};
zone "<%= zone %>" {
zone "<%= @zone %>" {
type master;
<% if zone.match(/\//) -%>
file "<%= zonedir %>/db.<%= zone.sub(/\//, '-') %>";
<% if @zone.match(/\//) -%>
file "<%= @zonedir %>/db.<%= @zone.sub(/\//, '-') %>";
<% else -%>
file "<%= zonedir %>/db.<%= zone %>";
file "<%= @zonedir %>/db.<%= @zone %>";
<% end -%>
allow-transfer {
<% if slaves != [] -%>
<% slaves.each_pair do |k, v| -%>
<% if @slaves != [] -%>
<% @slaves.each_pair do |k, v| -%>
<%= v['ip'] %>;
<% end -%>
<% else -%>
@ -20,6 +20,6 @@ zone "<%= zone %>" {
<% end -%>
};
allow-update {
key <%= zone %>;
key <%= @zone %>;
};
};

View file

@ -1,8 +1,8 @@
zone "<%= zone %>" {
zone "<%= @zone %>" {
type forward;
forward only;
forwarders {
<% forwarders.each do |ip| -%>
<% @forwarders.each do |ip| -%>
<%= ip %>;
<% end -%>
};

View file

@ -1,13 +1,13 @@
zone "<%= zone %>" {
zone "<%= @zone %>" {
type master;
<% if zone.match(/\//) -%>
file "<%= zonedir %>/db.<%= zone.sub(/\//, '-') %>";
<% if @zone.match(/\//) -%>
file "<%= @zonedir %>/db.<%= @zone.sub(/\//, '-') %>";
<% else -%>
file "<%= zonedir %>/db.<%= zone %>";
file "<%= @zonedir %>/db.<%= @zone %>";
<% end -%>
allow-transfer {
<% if slaves != [] -%>
<% slaves.each_pair do |k, v| -%>
<% if @slaves != [] -%>
<% @slaves.each_pair do |k, v| -%>
<%= v['ip'] %>;
<% end -%>
<% else -%>

View file

@ -1,18 +1,18 @@
zone "<%= zone %>" {
zone "<%= @zone %>" {
type slave;
<% if zone.match(/\//) %>
file "<%= zonedir %>/db.<%= zone.sub(/\//, '-') %>";
<% if @zone.match(/\//) %>
file "<%= @zonedir %>/db.<%= @zone.sub(/\//, '-') %>";
<% else -%>
file "<%= zonedir %>/db.<%= zone %>";
file "<%= @zonedir %>/db.<%= @zone %>";
<% end -%>
<% if master.is_a?(Hash) -%>
<% if @master.is_a?(Hash) -%>
masters {
<% master.each_pair do |k, v| -%>
<% @master.each_pair do |k, v| -%>
<%= v['ip'] %>;
<% end -%>
};
<% else -%>
masters { <%= master %>; };
masters { <%= @master %>; };
<% end -%>
allow-transfer { none; };
};