]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/resolv/templates/resolv.conf.erb
add resolv class for grnet
[dsa-puppet.git] / modules / resolv / templates / resolv.conf.erb
1 ##
2 ### THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ###
5
6 <%=
7 nameservers = []
8 searchpaths = []
9 resolvconf  = ''
10
11 case hoster
12   when "darmstadt" then
13     case hostname
14       when "draghi", "liszt" then
15         nameservers << "127.0.0.1"
16     end
17     nameservers += ["82.195.75.81", "82.195.66.249", "217.198.242.225"]
18     searchpaths << "debprivate-darmstadt.debian.org"
19   when "ftcollins" then
20     case hostname
21       when "spohr", "samosa" then
22         nameservers << "127.0.0.1"
23     end
24     nameservers += ["192.25.206.33", "192.25.206.57"]
25     searchpaths << "debprivate-ftcollins.debian.org"
26   when "grnet" then
27     nameservers += ["194.177.210.10", "194.177.210.210"]
28     searchpaths += "debprivate-grnet.debian.org"
29   when "ubcece" then
30     searchpaths << "debprivate-ubc.debian.org"
31     nameservers += ["206.12.19.5", "137.82.1.1", "142.103.1.1" ]
32 end
33
34 searchpaths << "debian.org"
35
36 if nameservers.empty?
37   raise Puppet::ParseError, "Something has gone wrong writing resolv.conf: probably included for wrong hoster"
38 end
39
40 resolvconf += "search " + searchpaths.join(" ") + "\n"
41 nameservers.each do |ns|
42   resolvconf += "nameserver " + ns + "\n"
43 end
44
45 resolvconf
46 %>