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 -%> <%- 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 scope.lookupvar('osfamily') == 'Debian' -%> include "<%= @confdir %>/named.conf.default-zones"; <%- end -%> <%- Array(@zones).each do |zone| -%> include "<%= @confdir %>/zones/<%= zone %>.conf"; <%- end -%> };