5 This device is for authorized users only. All traffic on this device
6 is monitored and will be used as evidence for prosecutions. By using
7 this machine you agree to abide by the Debian Machines Usage Policies
8 <URL:http://www.debian.org/devel/dmup>.
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 #s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n ")
15 s.split("\n").map{ |x|
16 if (x.length > width) then
17 #x.gsub!(/(.{1,#{width}}) +(?=\S)/, "\\1\n ")
18 x.gsub!(/(.{1,#{width}})( +|\Z)/, "\\1\n ")
25 l = l.gsub(/\[\[(.*?)\|(.*?)\]\]/, '\2')
26 l = l.gsub(/\[\[(\*|-)?(.*?)\]\]/, '\2')
30 if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture')
31 arch = scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0]
37 if scope.lookupvar('site::nodeinfo').has_key?('nameinfo')
38 purp += " " + wrap(scope.lookupvar('site::nodeinfo')['nameinfo']) + "\n"
41 ninfo = scope.lookupvar('site::nodeinfo')
43 extra = 'Welcome to ' + @fqdn
44 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose'))
45 p = scope.lookupvar('site::nodeinfo')['ldap']['purpose'].clone()
49 entries += ", the Debian #{arch} build daemon"
51 if p.delete('porterbox') or classes.include?("porterbox")
52 entries += ", the Debian #{arch} porterbox"
56 entries += (entries == "") ? ", " : ". Also"
57 entries +="used for the following services:\n"
58 scope.lookupvar('site::nodeinfo')['ldap']['purpose'].sort.each do |l|
69 purp += " " + wrap(extra) + "\n"
71 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('physicalHost'))
72 if ninfo['ldap']['physicalHost'][0] =~ /ganeti/
75 phys_host = 'physical host'
77 purp += wrap(" This virtual server runs on the #{phys_host} #{ninfo['ldap']['physicalHost'][0]}, " +
78 "which is hosted at #{ninfo['hoster']['longname']}."
80 elsif scope.lookupvar('site::nodeinfo')['hoster']['name']
81 purp += wrap(" This server is hosted at #{ninfo['hoster']['longname']}.")
86 scope.lookupvar('site::allnodeinfo').keys.sort.each do |node|
87 if scope.lookupvar('site::allnodeinfo')[node]['physicalHost'] and scope.lookupvar('site::allnodeinfo')[node]['physicalHost'].include?(@fqdn)
92 purp += "\nThe following virtual machines run on this system:\n"
95 if scope.lookupvar('site::allnodeinfo')[node]['purpose']
97 scope.lookupvar('site::allnodeinfo')[node]['purpose'].sort.each do |l|
99 purp += "\t " + l + "\n"
108 if scope.lookupvar('::cluster')
109 purp += "\n This server is a node in ganeti cluster: "
110 purp += scope.lookupvar('::cluster').to_s + ":\n"
111 purp += "\t" + scope.lookupvar('::cluster_nodes').split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n"
114 purp += "\tCurrently the master node is $(cat /var/lib/ganeti/ssconf_master_node).\n"
115 #nodes = scope.lookupvar('::cluster_nodes').sort
116 #nodes.each do |node|
117 # purp += "\t" + node + "\n"
119 #nodes.reject{|node| node.eql?(fqdn)}.each do |node|
120 # purp += "\t" + node + "\n"
121 # scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
122 # purp += "\t\t" + ip + "\n"
128 if classes.include?("porterbox")
129 purp += "\n " + wrap("Disk space on porter boxes is often limited. Please respect your fellow porters by cleaning up after yourself and deleting schroots and source/build trees in your ~ as soon as feasible. DSA reserves the right to recover disk space as necessary. See <URL:https://dsa.debian.org/doc/schroot/> for a brief tutorial on using schroot. There may be chroots for architectures other than #{arch} available, please list available chroots to check.")
132 if ninfo['not-bacula-client'] then
133 purp += "\n " + wrap("Note that this host is _NOT_ being backed up. If you care about your data, run your own backups.")
136 if scope.lookupvar('site::nodeinfo').has_key?('footer')
137 purp += "\n" + wrap(scope.lookupvar('site::nodeinfo')['footer'])
142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
147 # vim:set sts=2 ts=2:
148 # vim:set shiftwidth=2: