X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fresolv%2Ftemplates%2Fresolv.conf.erb;h=531b516593fddf284f08eaac38d19fc31891fd34;hb=9eb49205d5b9f3046a885fa1e219288c509fe970;hp=cb493a9c3c16836f7502182c0cdaf4e7ab2c1962;hpb=78b067acbc1f5e9aa0f0b4c4d6391c54e5a88a6c;p=mirror%2Fdsa-puppet.git diff --git a/modules/resolv/templates/resolv.conf.erb b/modules/resolv/templates/resolv.conf.erb index cb493a9c3..531b51659 100644 --- a/modules/resolv/templates/resolv.conf.erb +++ b/modules/resolv/templates/resolv.conf.erb @@ -8,7 +8,7 @@ nameservers = [] searchpaths = [] options = [] -if %w{draghi liszt widor spohr}.include?(hostname) +if %w{draghi liszt}.include?(hostname) nameservers << "127.0.0.1" end @@ -18,16 +18,19 @@ options += nodeinfo['hoster']['resolvoptions'] if nodeinfo['hoster']['resolvopti 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