]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/resolv/templates/resolv.conf.erb
massive style guide fixups
[dsa-puppet.git] / modules / resolv / templates / resolv.conf.erb
index ad7ac72381c2f8fdcde9894da4cc0fc5b75592e9..dfea77861363010f866fdcb82455bddd1b7aea6d 100644 (file)
@@ -8,24 +8,27 @@ nameservers = []
 searchpaths = []
 options = []
 
-if %w{draghi liszt widor spohr}.include?(hostname)
+if %w{draghi liszt}.include?(hostname)
   nameservers << "127.0.0.1"
 end
 
-nameservers += nodeinfo['hoster']['nameservers'] if nodeinfo['hoster']['nameservers']
-searchpaths += nodeinfo['hoster']['searchpaths'] if nodeinfo['hoster']['searchpaths']
-options += nodeinfo['hoster']['resolvoptions'] if nodeinfo['hoster']['resolvoptions']
+nameservers += scope.lookupvar('site::nodeinfo')['hoster']['nameservers'] if scope.lookupvar('site::nodeinfo')['hoster']['nameservers']
+searchpaths += scope.lookupvar('site::nodeinfo')['hoster']['searchpaths'] if scope.lookupvar('site::nodeinfo')['hoster']['searchpaths']
+options += scope.lookupvar('site::nodeinfo')['hoster']['resolvoptions'] if scope.lookupvar('site::nodeinfo')['hoster']['resolvoptions']
 
 searchpaths << "debian.org"
 
 resolvconf  = ''
 resolvconf += "search " + searchpaths.join(" ") + "\n"
 
-if unbound and unbound == "true"
+if has_variable?('unbound') and unbound and unbound == "true"
   resolvconf += "nameserver 127.0.0.1\n"
 else
   if nameservers.empty?
-    raise Puppet::ParseError, "Something has gone wrong writing resolv.conf.  No nameservers to use!"
+    #raise Puppet::ParseError, "Something has gone wrong writing resolv.conf.  No nameservers to use!"
+    scope.function_warning(["Something has gone wrong writing resolv.conf.  No nameservers to use - using google's!"])
+    nameservers << '8.8.8.8'
+    nameservers << '8.8.4.4'
   end
 
   nameservers.each do |ns|