FAQ
Hi,

I created a custom function by reading the doc from here
http://docs.puppetlabs.com/guides/custom_functions.html

It's a function to return proper filepath for a specific node by looking
at various stuff like facter, absolute path location etc. Now, I have a
requirement to log the actual path returned by the function in
/var/log/puppet/puppet.log.

How can I do that? Does this question better suited for puppet-dev or it
can be done easily? I want to use the function that's used to send debug
log in custom parser function.

--
Cheers,
Abhijeet R
http://blog.abhijeetr.com

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Jeff McCune at Nov 14, 2012 at 4:42 pm

    On Wed, Nov 14, 2012 at 4:29 AM, Abhijeet R wrote:
    Hi,

    I created a custom function by reading the doc from here
    http://docs.puppetlabs.com/guides/custom_functions.html

    It's a function to return proper filepath for a specific node by looking at
    various stuff like facter, absolute path location etc. Now, I have a
    requirement to log the actual path returned by the function in
    /var/log/puppet/puppet.log.

    How can I do that? Does this question better suited for puppet-dev or it can
    be done easily? I want to use the function that's used to send debug log in
    custom parser function.
    You can simply use `debug "Hello World!"` inside the block passed to
    the `newfunction` method. You can see how the built in template()
    function logs debug messages at:

    https://github.com/puppetlabs/puppet/blob/3.0.1/lib/puppet/parser/functions/template.rb#L11

    Hope this helps,
    -Jeff

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Abhijeet R at Nov 16, 2012 at 3:23 pm
    Thanks. That worked. :)
    On Wed 14 Nov 2012 10:11:10 PM IST, Jeff McCune wrote:
    On Wed, Nov 14, 2012 at 4:29 AM, Abhijeet R wrote:
    Hi,

    I created a custom function by reading the doc from here
    http://docs.puppetlabs.com/guides/custom_functions.html

    It's a function to return proper filepath for a specific node by looking at
    various stuff like facter, absolute path location etc. Now, I have a
    requirement to log the actual path returned by the function in
    /var/log/puppet/puppet.log.

    How can I do that? Does this question better suited for puppet-dev or it can
    be done easily? I want to use the function that's used to send debug log in
    custom parser function.
    You can simply use `debug "Hello World!"` inside the block passed to
    the `newfunction` method. You can see how the built in template()
    function logs debug messages at:

    https://github.com/puppetlabs/puppet/blob/3.0.1/lib/puppet/parser/functions/template.rb#L11

    Hope this helps,
    -Jeff
    --
    Cheers,
    Abhijeet R
    http://blog.abhijeetr.com

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedNov 14, '12 at 9:29a
activeNov 16, '12 at 3:23p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Abhijeet R: 2 posts Jeff McCune: 1 post

People

Translate

site design / logo © 2022 Grokbase