]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/resolv/templates/resolv.conf.erb
And manda, dgi and ftc
[dsa-puppet.git] / modules / resolv / templates / resolv.conf.erb
index 20b75692b8cab81b32ea232c27b681456db62bcc..4f7cd63da7937e41a8ce778a34f8325a274aedc8 100644 (file)
@@ -1,12 +1,30 @@
-<%= resolvconf = case hoster
-    when "ubcece" then "search debprivate-ubc.debian.org debian.org
-nameserver 206.12.19.5
-nameserver 137.82.1.1
-nameserver 142.103.1.1
-"
+##
+### THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+###
+
+<%=
+nameservers = []
+searchpaths = []
+resolvconf  = ''
+
+if %w{draghi liszt widor spohr samosa}.include?(hostname)
+  nameservers << "127.0.0.1"
 end
-if resolvconf = ""
-  raise Puppet::ParseError, "resolv.conf is empty"
+
+nameservers += hosterinfo['nameservers'] if hosterinfo['nameservers']
+searchpaths += hosterinfo['searchpaths'] if hosterinfo['searchpaths']
+
+searchpaths << "debian.org"
+
+if nameservers.empty?
+  raise Puppet::ParseError, "Something has gone wrong writing resolv.conf: probably included for wrong hoster"
 end
+
+resolvconf += "search " + searchpaths.join(" ") + "\n"
+nameservers.each do |ns|
+  resolvconf += "nameserver " + ns + "\n"
+end
+
 resolvconf
 %>