]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/resolv/templates/resolv.conf.erb
no more lenny
[dsa-puppet.git] / modules / resolv / templates / resolv.conf.erb
index 2ca70739f6a8c2199e11ad24194bccbd5de85128..2e1968b639785d625a38b1cd0e45ffbf58e5ad7d 100644 (file)
@@ -6,20 +6,20 @@
 <%=
 nameservers = []
 searchpaths = []
-options = []
+options     = []
+resolvconf  = ''
 
-if %w{draghi liszt}.include?(hostname)
+if %w{draghi}.include?(hostname)
   nameservers << "127.0.0.1"
 end
 
 nameservers += scope.lookupvar('ns')
-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 += scope.lookupvar('sp')
+options     += scope.lookupvar('opts')
 
 searchpaths << "debian.org"
 
-resolvconf  = ''
-resolvconf += "search " + searchpaths.join(" ") + "\n"
+resolvconf += "search " + searchpaths.to_a.flatten.join(" ") + "\n"
 
 if has_variable?('unbound') and unbound and unbound == "true"
   resolvconf += "nameserver 127.0.0.1\n"
@@ -36,7 +36,7 @@ else
   end
 end
 
-options.each do |opt|
+options.to_a.flatten.each do |opt|
   resolvconf += "options " + opt + "\n"
 end