puppet-bind/templates/view.erb
Nate Riffe 57002c31a4 Include the default zones on RedHat
RedHat's default zones are baked into the stock named.conf, which the module's
template completely rewrites. Since the module is extremely view-based, and the
Debian default-zones are repositioned into the zones, let's take those defaults
out of the stock named.conf, build a configuration file out of them and include
it in the view just the same.
2016-01-29 07:32:54 -06:00

55 lines
1.6 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 @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 @default_zones_include -%>
include "<%= @default_zones_include %>";
<%- end -%>
<%- Array(@zones).each do |zone| -%>
include "<%= @confdir %>/zones/<%= zone %>.conf";
<%- end -%>
};