Move noise to some place less annoying
[mirror/dsa-puppet.git] / modules / motd / templates / motd.erb
1
2 This device is for authorized users only.  All traffic on this device
3 is monitored and will be used as evidence for prosecutions.  By using
4 this this maching you agree to abide to the Debian Machines Usage Policies
5 (http://www.debian.org/devel/dmup)
6
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8
9 <%=
10 def wrap(s, width=78)
11       s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
12 end
13
14 purp = ''
15 if nodeinfo.has_key?('nameinfo')
16   purp += wrap(nodeinfo['nameinfo']) + "\n\n"
17 end
18
19 purp += 'Welcome to ' + fqdn
20 if (nodeinfo['ldap'].has_key?('purpose'))
21   if nodeinfo['ldap']['purpose'].include?('buildd')
22     purp += ", the Debian "
23     if nodeinfo['ldap'].has_key?('architecture')
24       purp += nodeinfo['ldap']['architecture'][0]
25     end
26     purp += " build daemon\n"
27   elsif nodeinfo['ldap']['purpose'].include?('porterbox')
28     purp += ", the Debian "
29     if nodeinfo['ldap'].has_key?('architecture')
30       purp += nodeinfo['ldap']['architecture'][0]
31     end
32     purp += " porterbox\n"
33     purp += "\n"
34     purp += "See 'dchroot -l' for a list of available chroots.\n"
35     if nodeinfo['ldap'].has_key?('admin')
36       purp += "Please contact #{nodeinfo['ldap']['admin'][0]} for install requests,\n"
37       purp += "following the recommendations in <URL:http://dsa.debian.org/doc/install-req/>.\n"
38     end
39   else
40     purp += ", used for the following services:\n"
41     nodeinfo['ldap']['purpose'].sort.each do |l|
42       if l =~ /\[\[(\*|-)?(.*?)\]\]/
43         l = $2
44       end
45       if l =~ /\[\[(.*?)\|(.*?)\]\]/
46         l = $2
47       end
48       purp += "\t" + l + "\n"
49     end
50   end
51 else
52   purp += "\n"
53 end
54
55 if (nodeinfo['ldap'].has_key?('physicalHost'))
56   purp += "\nThis virtual server runs on the physical host #{nodeinfo['ldap']['physicalHost'][0]}.\n"
57 end
58
59 if nodeinfo.has_key?('footer')
60   purp += "\n" + wrap(nodeinfo['footer']) + "\n"
61 end
62 purp
63 -%>
64
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67 <%
68 # vim:set et:
69 # vim:set sts=2 ts=2:
70 # vim:set shiftwidth=2:
71 -%>