X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fresolv%2Ftemplates%2Fresolv.conf.erb;h=2946517ae23b577eddd2a158bb2b716f50c0949e;hb=0929043d28f0aa4e8d99d3ab5cc08d4d7d09d92c;hp=d287287b43924e901b92af2bb802c17aed7e4de6;hpb=3f6ea8ed8aa29e573773b10580243295b0042c79;p=dsa-puppet.git diff --git a/modules/resolv/templates/resolv.conf.erb b/modules/resolv/templates/resolv.conf.erb index d287287b..2946517a 100644 --- a/modules/resolv/templates/resolv.conf.erb +++ b/modules/resolv/templates/resolv.conf.erb @@ -1,12 +1,43 @@ -<%= 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 = '' + +case hoster + when "ubcece" then + searchpaths << "debprivate-ubc.debian.org" + nameservers += ["206.12.19.5", "137.82.1.1", "142.103.1.1" ] + when "darmstadt" then + case hostname + when "draghi", "liszt" then + nameservers << "127.0.0.1" + end + nameservers += ["82.195.66.249", "217.198.242.225"] + searchpaths << "debprivate-darmstadt.debian.org" + when "ftcollins" then + case hostname + when "spohr", "samosa" then + nameservers << "127.0.0.1" + end + nameservers += ["192.25.206.33", "192.25.206.57"] + searchpaths << "debprivate-ftcollins.debian.org" end -if resolvconf == "" - raise Puppet::ParseError, "resolv.conf is empty" + +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 %>