Hi Nicolas,

Aside from the existing Ruby hook
<https://github.com/puppetlabs/razor-server/tree/master/hooks/hostname.hook>,
I'm not aware of any other existing hooks for that purpose, so you'd need
to write one specifically for your needs. Fortunately, you can write it in
any executable language and the contract for how it gets executed is documented
here <https://docs.puppet.com/pe/latest/razor_hooks.html>.

The gist for what the script needs to output is here:
https://github.com/puppetlabs/razor-server/blob/master/hooks/hostname.hook/node-bound-to-policy#L28-L34

And since your use case seems primarily based on info that is sent as
input, this is what the input structure looks like:
https://docs.puppet.com/pe/latest/razor_hooks.html#sample-input

Hope that helps get you started. Let me know if you need any more
assistance.

Scott

On Tue, Nov 15, 2016 at 10:04 AM Nicolas Stojanovic <[email protected]> wrote:

> Hi,
>
> Sorry if the question was already answered, I didn't find it.
>
> I'm looking to provision hundreds of physical servers with different
> hardware specs.
> I need to link a specific hostname to something unique (serial number or
> MAC), this hostname we'll be used by puppet for the next stage
> I could understood a hook could do this for me, but unfortunately no so
> fluent in json/ruby/....
>
> The hook need to parse/access a file with corresponding matching.
>
> Does someone have a hook already written that I could use and adapt a bit
> to match my specific environment?
>
> that will be really helpful
>
> Thanks
> Nicolas
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "puppet-razor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/puppet-razor.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
-- 
PuppetConf 2016 <https://puppet.com/puppetconf>, 19 - 21 October, San
Diego, California
*Register to attend or sign up to view the Live Stream
<https://puppet.com/puppetconf/registration-pricing>*

-- 
You received this message because you are subscribed to the Google Groups 
"puppet-razor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/puppet-razor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to