Actually, I'm 90% sure that John is correct in that the munging and
validation hooks run on the server.

Corey, you can snag the learning type/provider that I pushed into the forge
and it should print everything to the logs appropriately.

https://forge.puppetlabs.com/onyxpoint/learning_custom_types

I haven't tested it in Puppet 4 yet, but it should work.

Thanks,

Trevor

On Mon, Dec 14, 2015 at 11:29 AM, Felix Frank <
[email protected]> wrote:

> Hi,
>
> On 12/14/2015 04:12 PM, John Bollinger wrote:
> >     So if I wanted to run some validation in the type code, where does
> >     that get run?  node or master?
> >
> >
> >
> > Validation and munging hooks for property and parameter values
> > definitely run on the master.  If you try to specify an invalid value
> > then catalog building will fail.  I don't recall whether they run again
> > on the node.
>
> Nope. All the compiler does is make sure that all attributes you specify
> are available for the resource type in question.
>
> All hooks are invoked by the agent. Yes, the whole catalog will fail
> before any resource is checked or synced, but that's because validation
> etc. is run at the very start of the agent transaction.
>
> >      The reason why I am asking because not only do I want to validate
> >     that the user specified a absolute path, but also verify the file
> >     exists.  But this would only work if the File.exists? method in the
> >     validate block for the type code is executed on the node.
> >
> >
> >
> > This is not a job for a validation hook, but your provider can perform
> > such a test at whatever point is appropriate, and fail the resource if
> > need be.  Since it is conceivable that the file of interest might itself
> > be managed by Puppet, this also seems like a textbook case for an
> > autorequire
> > <
> https://docs.puppetlabs.com/guides/custom_types.html#automatic-relationships
> >
> > -- /that/ would appear in the type, not the provider.
>
> Agreed! Validation should be a function that yields the same result for
> the same input in any circumstance.
>
> Cheers,
> Felix
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/566EEE5F.8040009%40alumni.tu-berlin.de
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699

-- This account not approved for unencrypted proprietary information --

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoUwUbFpM58-q0iT4mRkcH1qBrK7uhombxcpHw4XFUgLkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to