]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/resolv/templates/resolv.conf.erb
move dns info for osuosl and grnet to hosters.yaml
[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 hosterinfo["name"]
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 "dgi" then
20     case hostname
21       when "widor" then
22          nameserver << "127.0.0.1"
23     end
24     nameservers += ["195.49.152.215", "195.49.152.213", "195.49.152.214"]
25   when "ftcollins" then
26     case hostname
27       when "spohr", "samosa" then
28         nameservers << "127.0.0.1"
29     end
30     nameservers += ["192.25.206.33", "192.25.206.57"]
31     searchpaths << "debprivate-ftcollins.debian.org"
32 end
33
34 nameservers += hosterinfo['nameservers'] if hosterinfo['nameservers']
35 searchpaths += hosterinfo['searchpaths'] if hosterinfo['searchpaths']
36
37 searchpaths << "debian.org"
38
39 if nameservers.empty?
40   raise Puppet::ParseError, "Something has gone wrong writing resolv.conf: probably included for wrong hoster"
41 end
42
43 resolvconf += "search " + searchpaths.join(" ") + "\n"
44 nameservers.each do |ns|
45   resolvconf += "nameserver " + ns + "\n"
46 end
47
48 resolvconf
49 %>