]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Update README with getvar() and validate_hash()
authorJeff McCune <jeff@puppetlabs.com>
Wed, 22 Jun 2011 00:06:46 +0000 (17:06 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Wed, 22 Jun 2011 00:06:46 +0000 (17:06 -0700)
The README now provides quick examples of how to take advantage of the
getvar() and validate_hash() functions included in this release of the
stdlib.

README.markdown

index f79b975976fb9d69bb74000c1dfba2abdc9a1a8c..1e93c6fffb90f8aaf984e13e23d219261541605b 100644 (file)
@@ -28,4 +28,18 @@ TBA
 
   Jeff McCune <jeff@puppetlabs.com>
 
+# Functions #
+## validate\_hash ##
 
+    $somehash = { 'one' => 'two' }
+    validate\_hash($somehash)
+
+## getvar() ##
+
+This function aims to look up variables in user-defined namespaces within
+puppet.  Note, if the namespace is a class, it should already be evaluated
+before the function is used.
+
+    $namespace = 'site::data'
+    include "${namespace}"
+    $myvar = getvar("${namespace}::myvar")