Allow the services array to contain hostlists in addition to single hostnames, and...
[mirror/dsa-puppet.git] / files / etc / puppet / lib / puppet / parser / functions / nodeinfo.rb
index a25c31a..aa641c3 100644 (file)
@@ -22,10 +22,9 @@ module Puppet::Parser::Functions
     end
 
     if yaml.has_key?('services')
-      ['bugsmaster', 'qamaster', 'mailrelay', 'rtmaster', 'packagesmaster', 'packagesqamaster'].each do |service|
-        if yaml['services'].has_key?(service)
-          results[service] = host == yaml['services'][service]
-        end
+      yaml['services'].each_pair do |service, hostlist|
+        hostlist=[hostlist] unless hostlist.kind_of?(Array)
+        results[service] = hostlist.include?(host)
       end
     end