Distinguish view access from recursion access

Make recursion_match_clients and recursion_match_destinations mirroring the
existing match_clients and match_destinations in order to distinguish recursion
access as a proper subset of view access.
This commit is contained in:
Nate Riffe 2014-11-28 19:02:23 -06:00
parent 66cc6ea21d
commit e365f5e49a
2 changed files with 13 additions and 9 deletions

View File

@ -1,10 +1,12 @@
# ex: syntax=puppet si ts=4 sw=4 et # ex: syntax=puppet si ts=4 sw=4 et
define bind::view ( define bind::view (
$match_clients = 'any', $match_clients = 'any',
$match_destinations = '', $match_destinations = '',
$zones = [], $zones = [],
$recursion = true, $recursion = true,
$recursion_match_clients = 'any',
$recursion_match_destinations = '',
) { ) {
$confdir = $bind::params::confdir $confdir = $bind::params::confdir

View File

@ -16,18 +16,20 @@ view "<%= @name %>" {
<%- end -%> <%- end -%>
recursion <%= @recursion ? 'yes' : 'no' %>; recursion <%= @recursion ? 'yes' : 'no' %>;
<%- if @recursion -%> <%- if @recursion -%>
<%- if @match_clients and @match_clients != '' -%> <%- if @recursion_match_clients and @recursion_match_clients != '' -%>
allow-recursion { allow-recursion {
<%- Array(@match_clients).each do |match_client| -%> <%- Array(@recursion_match_clients).each do |match_client| -%>
<%= match_client %>; <%= match_client %>;
<%- end -%> <%- end -%>
<%- elsif @match_destinations and @match_destinations != '' -%> };
<%- end -%>
<%- if @recursion_match_destinations and @recursion_match_destinations != '' -%>
allow-recursion-on { allow-recursion-on {
<%- Array(@match_destinations).each do |match_destination| -%> <%- Array(@recursion_match_destinations).each do |match_destination| -%>
<%= match_destination %>; <%= match_destination %>;
<%- end -%> <%- end -%>
<%- end -%>
}; };
<%- end -%>
<%- end -%> <%- end -%>
<%- if scope.lookupvar('osfamily') == 'Debian' -%> <%- if scope.lookupvar('osfamily') == 'Debian' -%>
include "<%= @confdir %>/named.conf.default-zones"; include "<%= @confdir %>/named.conf.default-zones";