puppet-bind/templates/view.erb

54 lines
1.4 KiB
Plaintext

view "<%= @name %>" {
<%- if @match_clients and @match_clients != '' -%>
match-clients {
<%- Array(@match_clients).each do |match_client| -%>
<%= match_client %>;
<%- end -%>
};
<%- end -%>
<%- if @match_destinations and @match_destinations != '' -%>
match-destinations {
<%- Array(@match_destinations).each do |match_destination| -%>
<%= match_destination %>;
<%- end -%>
};
<%- end -%>
recursion <%= @recursion ? 'yes' : 'no' %>;
<%- if @recursion_match_only -%>
match-recursive-only yes;
<%- end -%>
<%- if @recursion -%>
<%- if @recursion_match_clients and @recursion_match_clients != '' -%>
allow-recursion {
<%- Array(@recursion_match_clients).each do |match_client| -%>
<%= match_client %>;
<%- end -%>
};
<%- end -%>
<%- if @recursion_match_destinations and @recursion_match_destinations != '' -%>
allow-recursion-on {
<%- Array(@recursion_match_destinations).each do |match_destination| -%>
<%= match_destination %>;
<%- end -%>
};
<%- end -%>
<%- end -%>
<%- if @server -%>
<%- @server.each_pair do |srv, srv_values| -%>
server <%= srv %> {
<%- Array(srv_values).each do |srv_value| -%>
<%= srv_value %>;
<%- end -%>
};
<%- end -%>
<%- end -%>
<%- if scope.lookupvar('osfamily') == 'Debian' -%>
include "<%= @confdir %>/named.conf.default-zones";
<%- end -%>
<%- Array(@zones).each do |zone| -%>
include "<%= @confdir %>/zones/<%= zone %>.conf";
<%- end -%>
};