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