Make even purposeless (useless?) hosts have nicely formatted motds
[mirror/dsa-puppet.git] / modules / motd / templates / motd.erb
1 This device is for authorized users only.  All traffic on this device
2 is monitored and will be used as evidence for prosecutions.
3
4 ** IMPORTANT WARNING **
5
6 Please read:
7
8 http://lists.debian.org/debian-devel-announce/2003/debian-devel-announce-200312/msg00001.html
9
10 before doing anything on these machines - especially the "What to do
11 when you can login" section.
12
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 <%=
16 purp = ''
17 if nodeinfo.has_key?('nameinfo')
18   purp += nodeinfo['nameinfo'] + "\n\n"
19 end
20
21 purp += 'Welcome to ' + fqdn
22 if (nodeinfo['ldap'].at(0)) and (nodeinfo['ldap'][0].has_key?('purpose'))
23   if nodeinfo['ldap'][0]['purpose'].include?('buildd')
24     purp += ", the Debian "
25     if nodeinfo['ldap'][0].has_key?('architecture')
26       purp += nodeinfo['ldap'][0]['architecture'][0]
27     end
28     purp += " build daemon\n"
29   elsif nodeinfo['ldap'][0]['purpose'].include?('porterbox')
30     purp += ", the Debian "
31     if nodeinfo['ldap'][0].has_key?('architecture')
32       purp += nodeinfo['ldap'][0]['architecture'][0]
33     end
34     purp += " porterbox\n"
35   else
36     purp += ", used for the following services:\n"
37     nodeinfo['ldap'][0]['purpose'].sort.each do |l|
38       if l =~ /\[\[(\*|-)?(.*?)\]\]/
39         l = $2
40       end
41       if l =~ /\[\[(.*?)\|(.*?)\]\]/
42         l = $2
43       end
44       purp += "\t" + l + "\n"
45     end
46   end
47 else
48   purp += "\n"
49 end
50
51 if nodeinfo.has_key?('footer')
52   purp += "\n" + nodeinfo['footer'] + "\n"
53 end
54 purp
55 -%>
56
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%