puppet-bind/templates/view.erb

106 lines
2.9 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 -%>
<%- if @allow_query and @allow_query != '' -%>
allow-query {
<%- Array(@allow_query).each do |query_client| -%>
<%= query_client %>;
<%- end -%>
};
<%- end -%>
<%- if @allow_query_on and @allow_query_on != '' -%>
allow-query-on {
<%- Array(@allow_query_on).each do |query_server| -%>
<%= query_server %>;
<%- end -%>
};
<%- end -%>
<%- if @allow_query_cache and @allow_query_cache != '' -%>
allow-query-cache {
<%- Array(@allow_query_cache).each do |query_client| -%>
<%= query_client %>;
<%- end -%>
};
<%- end -%>
<%- if @allow_query_cache_on and @allow_query_cache_on != '' -%>
allow-query-cache-on {
<%- Array(@allow_query_cache_on).each do |query_server| -%>
<%= query_server %>;
<%- end -%>
};
<%- end -%>
<%- end -%>
<%- if @allow_transfers and @allow_transfers != '' -%>
allow-transfer {
<%- Array(@allow_transfers).each do |allow_transfer| -%>
<%= allow_transfer %>;
<%- end -%>
};
<%- end -%>
<%- if @empty_zones != '' -%>
empty-zones-enable <%= @empty_zones ? 'yes' : 'no' %>;
<%- end -%>
<%- if @servers and @servers.is_a?(Array) -%>
<%- @servers.each do |properties| -%>
<%- raise Puppet::Error, 'view servers must have an ip_addr key' unless properties.has_key?('ip_addr') -%>
server <%= properties['ip_addr'] %> {
<%- if properties.has_key?('keys') and properties['keys'] != '' -%>
keys { <%= properties['keys'] %>; };
<%- end -%>
};
<%- end -%>
<%- end -%>
<%- if @minimal_responses -%>
minimal-responses yes;
<%- end -%>
<%- if @also_notify and @also_notify != '' -%>
also-notify {
<%- Array(@also_notify).each do |server| -%>
<%= server %>;
<%- end -%>
};
<%- end -%>
<%- if @notify_source and @notify_source != '' -%>
notify-source <%= @notify_source %>;
<%- end -%>
<%- if @include_default_zones and @default_zones_include -%>
include "<%= @default_zones_include %>";
<%- end -%>
<%- Array(@zones).each do |zone| -%>
include "<%= @confdir %>/zones/<%= zone %>.conf";
<%- end -%>
};