+
+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 not scope.lookupvar('::cluster').empty?
+ purp += "\nThis server is a node in ganeti cluster: "
+ purp += scope.lookupvar('::cluster') + ".\n"
+ nodes = scope.lookupvar('::cluster_nodes').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