]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/resolv/templates/resolv.conf.erb
And manda, dgi and ftc
[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 if %w{draghi liszt widor spohr samosa}.include?(hostname)
12   nameservers << "127.0.0.1"
13 end
14
15 nameservers += hosterinfo['nameservers'] if hosterinfo['nameservers']
16 searchpaths += hosterinfo['searchpaths'] if hosterinfo['searchpaths']
17
18 searchpaths << "debian.org"
19
20 if nameservers.empty?
21   raise Puppet::ParseError, "Something has gone wrong writing resolv.conf: probably included for wrong hoster"
22 end
23
24 resolvconf += "search " + searchpaths.join(" ") + "\n"
25 nameservers.each do |ns|
26   resolvconf += "nameserver " + ns + "\n"
27 end
28
29 resolvconf
30 %>