+
+
+vms = []
+scope.lookupvar('site::allnodeinfo').keys.sort.each do |node|
+ if scope.lookupvar('site::allnodeinfo')[node]['physicalHost'] and scope.lookupvar('site::allnodeinfo')[node]['physicalHost'].include?(fqdn)
+ vms << node
+ end
+end
+unless vms.empty?
+ purp += "\nThe following virtual machines run on this system:\n"
+ vms.each do |node|
+ purp += "\t- #{node}"
+ if scope.lookupvar('site::allnodeinfo')[node]['purpose']
+ purp += ":\n"
+ scope.lookupvar('site::allnodeinfo')[node]['purpose'].sort.each do |l|
+ l = markup(l)
+ purp += "\t " + l + "\n"
+ end
+ else
+ purp += "\n"
+ end
+ end
+end
+
+
+if scope.lookupvar('::cluster').to_s != 'undefined'
+ purp += "\nThis server is a node in ganeti cluster: "
+ purp += scope.lookupvar('::cluster').to_s + ":\n"
+ purp += "\t" + scope.lookupvar('::cluster_nodes').to_s.split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n"
+
+ if @lsbmajdistrelease >= '7'
+ purp += ""
+ purp += "\tCurrently the master node is $(cat /var/lib/ganeti/ssconf_master_node).\n"
+ end
+ #nodes = scope.lookupvar('::cluster_nodes').to_s.split.sort
+ #nodes.each do |node|
+ # purp += "\t" + node + "\n"
+ #end
+ #nodes.reject{|node| node.eql?(fqdn)}.each do |node|
+ # purp += "\t" + node + "\n"
+ # scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
+ # purp += "\t\t" + ip + "\n"
+ # end
+ #end
+end
+
+
+if scope.lookupvar('site::nodeinfo').has_key?('footer')
+ purp += "\n" + wrap(scope.lookupvar('site::nodeinfo')['footer']) + "\n"
+end
+