Merge remote-tracking branch 'origin/master' into staging
[mirror/dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / has_role.rb
index c8b537f..427440f 100644 (file)
@@ -7,6 +7,14 @@ module Puppet::Parser::Functions
         err "Failed to look up missing role #{role}"
         return false
       end
-      return roles[role].include?(fqdn)
-    end
+      case roles[role]
+        when Hash then roles[role].include?(fqdn)
+        else roles[role].map{ |k|
+               case k
+                 when Hash then k.keys.first
+                 else k
+               end
+             }.include?(fqdn)
+      end
+  end
 end