Add puppetlabs/certregen module
[mirror/dsa-puppet.git] / 3rdparty / modules / certregen / lib / puppet / functions / is_classified_with.rb
diff --git a/3rdparty/modules/certregen/lib/puppet/functions/is_classified_with.rb b/3rdparty/modules/certregen/lib/puppet/functions/is_classified_with.rb
new file mode 100644 (file)
index 0000000..0f6d54b
--- /dev/null
@@ -0,0 +1,9 @@
+Puppet::Functions.create_function(:is_classified_with) do
+  dispatch :is_classified_with do
+    param 'String', :str
+  end
+
+  def is_classified_with(str)
+    closure_scope.find_global_scope.compiler.node.classes.keys.include?(str.to_s)
+  end
+end