David Portabella
2013-Nov-29 08:58 UTC
[Puppet Users] validate hiera database against a schema
is there a way to validate a hiera database against a schema? the validation could be done as a whole (but that might not make sense, as the effective hierarchy depends on the context), or better, when calling hiera(''myvar'') from puppet (for instance). or maybe, this could be a new function (in puppet-stdlibs) *validate_against_schema($myvar, $schema).* does this feature make sense? is it planned? Regards, David -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/4f05755e-95e5-4005-950a-a97d9e83e7a6%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Dec-02 17:44 UTC
[Puppet Users] Re: validate hiera database against a schema
On Friday, November 29, 2013 2:58:19 AM UTC-6, David Portabella wrote:> > is there a way to validate a hiera database against a schema? >Not that I know of, no. Did you have a particular schema language in mind?> the validation could be done as a whole (but that might not make sense, as > the effective hierarchy depends on the context), > or better, when calling hiera(''myvar'') from puppet (for instance). > >Then it sounds like you are asking more about validating individual data items. Puppet still doesn''t have general-purpose schema validation for such things, but you can write context-specific validation in DSL or as one or more custom functions.> or maybe, this could be a new function (in puppet-stdlibs) *validate_against_schema($myvar, > $schema).* > > does this feature make sense? >Not without a particular schema language attached to it. And maybe not with one. It is not immediately evident to me that describing the expected form of the data in some schema language and then using that to validate would be in any way better than writing appropriate validation code in either Puppet DSL (for use in a Puppet manifest) or Ruby (for a custom function). You have to write custom code any way you do it, so what is the advantage of adding another language to the mix?> is it planned? > >I suspect not. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d1007049-a101-4863-ad04-cf51a99b2a50%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Nan Liu
2013-Dec-02 18:11 UTC
Re: [Puppet Users] Re: validate hiera database against a schema
On Mon, Dec 2, 2013 at 9:44 AM, jcbollinger <John.Bollinger@stjude.org>wrote:> > > On Friday, November 29, 2013 2:58:19 AM UTC-6, David Portabella wrote: >> >> is there a way to validate a hiera database against a schema? >> > > > Not that I know of, no. Did you have a particular schema language in mind? >Ken Barber done some work a while back with Kwalify, which could be suitable for this purpose: https://github.com/puppetlabs/puppetlabs-kwalify Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACqVBqBzLkVghKJTAg8f-5n-%2ByWoh%2B7%2BGN%2B5bAdTuAA8oNXJSg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.