1 <%- if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0 -%>
7 This device is for authorized users only. All traffic on this device
8 is monitored and will be used as evidence for prosecutions. By using
9 this machine you agree to abide by the Debian Machines Usage Policies
10 <URL:https://www.debian.org/devel/dmup>.
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16 #s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n ")
17 s.split("\n").map{ |x|
18 if (x.length > width) then
19 #x.gsub!(/(.{1,#{width}}) +(?=\S)/, "\\1\n ")
20 x.gsub!(/(.{1,#{width}})( +|\Z)/, "\\1\n ")
27 l = l.gsub(/\[\[(.*?)\|(.*?)\]\]/, '\2')
28 l = l.gsub(/\[\[(\*|-)?(.*?)\]\]/, '\2')
32 if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture')
33 arch = scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0]
39 if scope.lookupvar('site::nodeinfo').has_key?('nameinfo')
40 purp += " " + wrap(scope.lookupvar('site::nodeinfo')['nameinfo']) + "\n"
43 ninfo = scope.lookupvar('site::nodeinfo')
45 extra = 'Welcome to ' + @fqdn
46 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose'))
47 p = scope.lookupvar('site::nodeinfo')['ldap']['purpose'].clone()
50 if classes.include?("roles::buildd")
51 entries += ", the Debian #{arch} build daemon"
54 if classes.include?("roles::porterbox")
55 entries += ", the Debian #{arch} porterbox"
60 entries += (entries == "") ? ", " : ". Also "
61 entries +="used for the following services:\n"
62 scope.lookupvar('site::nodeinfo')['ldap']['purpose'].sort.each do |l|
73 purp += " " + wrap(extra) + "\n"
75 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('physicalHost'))
76 if ninfo['ldap']['physicalHost'][0] =~ /ganeti/
79 phys_host = 'physical host'
81 purp += wrap(" This virtual server runs on the #{phys_host} #{ninfo['ldap']['physicalHost'][0]}, " +
82 "which is hosted at #{ninfo['hoster']['longname']}."
84 elsif scope.lookupvar('site::nodeinfo')['hoster']['name']
85 purp += wrap(" This server is hosted at #{ninfo['hoster']['longname']}.")
90 scope.lookupvar('site::allnodeinfo').keys.sort.each do |node|
91 if scope.lookupvar('site::allnodeinfo')[node]['physicalHost'] and scope.lookupvar('site::allnodeinfo')[node]['physicalHost'].include?(@fqdn)
96 purp += "\nThe following virtual machines run on this system:\n"
99 if scope.lookupvar('site::allnodeinfo')[node]['purpose']
101 scope.lookupvar('site::allnodeinfo')[node]['purpose'].sort.each do |l|
103 purp += "\t " + l + "\n"
112 if scope.lookupvar('::cluster')
113 purp += "\n This server is a node in ganeti cluster: "
114 purp += scope.lookupvar('::cluster').to_s + ":\n"
115 purp += "\t" + scope.lookupvar('::cluster_nodes').split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n"
118 purp += "\tCurrently the master node is $(cat /var/lib/ganeti/ssconf_master_node).\n"
119 #nodes = scope.lookupvar('::cluster_nodes').sort
120 #nodes.each do |node|
121 # purp += "\t" + node + "\n"
123 #nodes.reject{|node| node.eql?(fqdn)}.each do |node|
124 # purp += "\t" + node + "\n"
125 # scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
126 # purp += "\t\t" + ip + "\n"
132 if classes.include?("roles::porterbox")
133 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.")
136 if classes.include?('bacula::not_a_client') then
137 purp += "\n " + wrap("Note that this host is _NOT_ being backed up. If you care about your data, run your own backups.")
140 if scope.lookupvar('site::nodeinfo').has_key?('footer')
141 purp += "\n" + wrap(scope.lookupvar('site::nodeinfo')['footer'])
146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 <%- if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0 -%>
153 # vim:set sts=2 ts=2:
154 # vim:set shiftwidth=2: