Merge branch 'master' of git+ssh://zobel@puppet.debian.org/srv/puppet.debian.org...
authorMartin Zobel-Helas <zobel@debian.org>
Tue, 26 May 2009 18:23:28 +0000 (20:23 +0200)
committerMartin Zobel-Helas <zobel@debian.org>
Tue, 26 May 2009 18:23:28 +0000 (20:23 +0200)
files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb

index 9f849ff..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
 
@@ -71,3 +70,5 @@ module Puppet::Parser::Functions
     return(results)
   end
 end
+
+# vim: set fdm=marker ts=2 sw=2 et: