Skip to content

Commit 754f860

Browse files
committed
Modify templates to be puppet 3.x compliant
1 parent ec4ef9f commit 754f860

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

templates/named.conf-header.erb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// File managed by puppet
1+
// This file is managed by Puppet. DO NOT EDIT.
2+
23
options {
3-
directory "<%= data_dir %>";
4+
directory "<%= @data_dir %>";
45
auth-nxdomain no;
56
listen-on-v6 { any; };
67
recursion yes;

templates/named.conf-zone.erb

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
zone "<%= zone_name %>" {
2-
type <%= zone_type %>;
3-
<% if zone_type == 'slave' or zone_type == 'master' or zone_type == 'hint' -%>
4-
file "<%= scope.lookupvar("bind::config_dir") %>/<%= zone_config_file %>";
1+
// This file is managed by Puppet. DO NOT EDIT.
2+
3+
zone "<%= @zone_name %>" {
4+
type <%= @zone_type %>;
5+
<% if @zone_type == 'slave' or @zone_type == 'master' or @zone_type == 'hint' -%>
6+
file "<%= scope.lookupvar("bind::config_dir") %>/<%= @zone_config_file %>";
57
<% end -%>
6-
<% if zone_type == 'slave' -%>
7-
masters { <%= zone_master %>; };
8+
<% if @zone_type == 'slave' -%>
9+
masters { <%= @zone_master %>; };
810
<% end -%>
9-
<% if zone_type == 'forward' -%>
11+
<% if @zone_type == 'forward' -%>
1012
forwarders {
11-
<% zone_forward.each do |forwarder|-%>
13+
<% @zone_forward.each do |forwarder|-%>
1214
<%= forwarder %>;
1315
<% end -%>
1416
};

templates/record.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<%= host %> <%= ttl %> <%= record_class %> <%= record_type %> <%= record_priority %> <%= target %>
1+
<%= @host %> <%= @ttl %> <%= @record_class %> <%= @record_type %> <%= @record_priority %> <%= @target %>

templates/spec.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>
55

66
# Custom Options
7-
<%= options['opt_a'] %>
8-
<%= options['opt_b'] %>
7+
<%= @options['opt_a'] %>
8+
<%= @options['opt_b'] %>

templates/zone-header.erb

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
; File managed by puppet
1+
; This file is managed by Puppet. DO NOT EDIT.
22

3-
<% if zone_ttl != '' -%>
4-
$TTL <%=zone_ttl%>
3+
<% if @zone_ttl != '' -%>
4+
$TTL <%= @zone_ttl %>
55
<% end -%>
6-
@ <%= zone_class %> SOA <%= real_zone_ns %> <%= real_zone_contact %> (
7-
<%= zone_serial %> ; serial
8-
<%= zone_refresh %> ; refresh
9-
<%= zone_retry %> ; retry
10-
<%= zone_expire %> ; expire
11-
<% if zone_neg_cache != '' -%>
12-
<%= zone_neg_cache %> ; TTL
6+
@ <%= @zone_class %> SOA <%= @real_zone_ns %> <%= @real_zone_contact %> (
7+
<%= @zone_serial %> ; serial
8+
<%= @zone_refresh %> ; refresh
9+
<%= @zone_retry %> ; retry
10+
<%= @zone_expire %> ; expire
11+
<% if @zone_neg_cache != '' -%>
12+
<%= @zone_neg_cache %> ; TTL
1313
<% end -%>
1414
);

0 commit comments

Comments
 (0)