-purp += 'Welcome to ' + fqdn
-if (nodeinfo['ldap'].has_key?('purpose'))
- if nodeinfo['ldap']['purpose'].include?('buildd')
- purp += ", the Debian "
- if nodeinfo['ldap'].has_key?('architecture')
- purp += nodeinfo['ldap']['architecture'][0]
- end
- purp += " build daemon\n"
- elsif nodeinfo['ldap']['purpose'].include?('porterbox')
- purp += ", the Debian "
- if nodeinfo['ldap'].has_key?('architecture')
- purp += nodeinfo['ldap']['architecture'][0]
- end
- purp += " porterbox\n"
- purp += "\n"
- purp += "See 'dchroot -l' or 'schroot -l' for a list of available chroots.\n"
- if nodeinfo['ldap'].has_key?('admin')
- purp += "Please contact #{nodeinfo['ldap']['admin'][0]} for install requests,\n"
- purp += "following the recommendations in <URL:http://dsa.debian.org/doc/install-req/>.\n"
- end
- else
- purp += ", used for the following services:\n"
- nodeinfo['ldap']['purpose'].sort.each do |l|
+ninfo = scope.lookupvar('site::nodeinfo')
+
+extra = 'Welcome to ' + fqdn
+if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose'))
+ p = scope.lookupvar('site::nodeinfo')['ldap']['purpose'].clone()
+ entries = ""
+
+ if p.delete('buildd')
+ entries += ", the Debian #{arch} build daemon"
+ end
+ if p.delete('porterbox') or classes.include?("porterbox")
+ entries += ", the Debian #{arch} porterbox"
+ end
+
+ if p.size() > 0
+ entries += (entries == "") ? ", " : ". Also"
+ entries +="used for the following services:\n"
+ scope.lookupvar('site::nodeinfo')['ldap']['purpose'].sort.each do |l|