]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
move allow_dns_query into hiera
[dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / nodeinfo.rb
index 303dfd21392685b4a7fdb9af3ba08e3de6762686..f1606dd7d0dfaa5002805576aca4f3fd99912061 100644 (file)
@@ -40,11 +40,12 @@ module Puppet::Parser::Functions
       end
 
       ns = function_hiera('nameservers')
+      allow_dns_q = function_hiera('allow_dns_query')
       if ns.empty?
         # no nameservers known for this hoster
         nodeinfo['misc']['resolver-recursive'] = true
 
-        if nodeinfo['hoster']['allow_dns_query']
+        if allow_dns_q
           raise Puppet::ParseError, "No nameservers listed for #{nodeinfo['hoster']['name']} yet we should answer somebody's queries?  That makes no sense."
         end
       elsif (nodeinfo['misc']['v4addrs'] and (ns & nodeinfo['misc']['v4addrs']).size > 0) or
@@ -52,7 +53,7 @@ module Puppet::Parser::Functions
         # this host is listed as a nameserver at this location
         nodeinfo['misc']['resolver-recursive'] = true
 
-        if not nodeinfo['hoster']['allow_dns_query'] or nodeinfo['hoster']['allow_dns_query'].empty?
+        if not allow_dns_q or allow_dns_q.empty?
           raise Puppet::ParseError, "Host #{host} is listed as a nameserver for #{nodeinfo['hoster']['name']} but no allow_dns_query networks are defined for this location"
         end
       else