From e365f5e49a7f8215bcefbcf1b8d223225f2c48ff Mon Sep 17 00:00:00 2001 From: Nate Riffe Date: Fri, 28 Nov 2014 19:02:23 -0600 Subject: [PATCH] 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. --- manifests/view.pp | 10 ++++++---- templates/view.erb | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/manifests/view.pp b/manifests/view.pp index f5717ad..5e2e942 100644 --- a/manifests/view.pp +++ b/manifests/view.pp @@ -1,10 +1,12 @@ # ex: syntax=puppet si ts=4 sw=4 et define bind::view ( - $match_clients = 'any', - $match_destinations = '', - $zones = [], - $recursion = true, + $match_clients = 'any', + $match_destinations = '', + $zones = [], + $recursion = true, + $recursion_match_clients = 'any', + $recursion_match_destinations = '', ) { $confdir = $bind::params::confdir diff --git a/templates/view.erb b/templates/view.erb index 866afd7..7760f9f 100644 --- a/templates/view.erb +++ b/templates/view.erb @@ -16,18 +16,20 @@ view "<%= @name %>" { <%- end -%> recursion <%= @recursion ? 'yes' : 'no' %>; <%- if @recursion -%> -<%- if @match_clients and @match_clients != '' -%> +<%- if @recursion_match_clients and @recursion_match_clients != '' -%> allow-recursion { -<%- Array(@match_clients).each do |match_client| -%> +<%- Array(@recursion_match_clients).each do |match_client| -%> <%= match_client %>; <%- end -%> -<%- elsif @match_destinations and @match_destinations != '' -%> + }; +<%- end -%> +<%- if @recursion_match_destinations and @recursion_match_destinations != '' -%> allow-recursion-on { -<%- Array(@match_destinations).each do |match_destination| -%> +<%- Array(@recursion_match_destinations).each do |match_destination| -%> <%= match_destination %>; <%- end -%> -<%- end -%> }; +<%- end -%> <%- end -%> <%- if scope.lookupvar('osfamily') == 'Debian' -%> include "<%= @confdir %>/named.conf.default-zones";