From e071b05ab631f4b73fed7178c52d0416f7629cb8 Mon Sep 17 00:00:00 2001 From: Ken Barber Date: Wed, 29 Jun 2011 12:30:07 +0100 Subject: Added kwalify function. --- README.markdown | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'README.markdown') 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. -- cgit v1.2.3