diff options
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown index ec4267c..68e559e 100644 --- a/README.markdown +++ b/README.markdown @@ -17,3 +17,32 @@ From github, download the module into your modulepath on your Puppetmaster. If y puppet --configprint modulepath Depending on the version of Puppet, you may need to restart the puppetmasterd (or Apache) process before the functions will work. + +## Functions + +### kwalify + +This function allows you to validate Puppet data structures using Kwalify +schemas as documented here: + +http://www.kuwata-lab.com/kwalify/ruby/users-guide.01.html + +To validate, create a schema in Puppet: + + $schema = { + 'type' => 'seq', + 'sequence' => [ + { 'type' => 'str' } + ] + } + +And create some content that you want validated: + + $document = ['a', 'b', 'c'] + +And then use the function to validate: + + kwalify($schema, $document) + +The function will throw an error and list all validation errors if there is a +problem otherwise it succeeds silently. |