searchpaths = []
options = []
-if %w{draghi liszt widor spohr samosa}.include?(hostname)
+if %w{draghi liszt spohr}.include?(hostname)
nameservers << "127.0.0.1"
end
searchpaths << "debian.org"
-if nameservers.empty?
- raise Puppet::ParseError, "Something has gone wrong writing resolv.conf: probably included for wrong hoster"
-end
-
resolvconf = ''
resolvconf += "search " + searchpaths.join(" ") + "\n"
-if runs_local_resolver
+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!"
+ 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|
resolvconf += "nameserver " + ns + "\n"
end