Notify: log only the message itself at 'notice' level

282 views
Skip to first unread message

Nacho Barrientos

unread,
Dec 1, 2014, 7:43:44 AM12/1/14
to puppet...@googlegroups.com
Hi all,

When using the Notify resource type, is there any way to hide the log
message that is produced by the definition itself and only keep the
actual message string on the output generated by Puppet agent?

In this example:

Notice: hello


Notice: /Stage[main]/Foo::Bar/Notify[baz]/message: defined 'message' as
'hello'

The idea would be to tell Puppet somehow to only print the following:

Notice: hello

We've tried passing "audit => []" as an attribute to the resource
declaration but it didn't produce any effect log-wise. Also we changed
the loglevel to 'debug' at resource level and it hid both.

We're (still) using Puppet 3.4.3.

Any ideas? :)

--
bye
Nacho

Spencer Krum

unread,
Dec 1, 2014, 10:25:22 AM12/1/14
to puppet...@googlegroups.com
Maybe you could use the notice() or warn() functions?

--
Spencer Krum
ni...@spencerkrum.com
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/547C60B7.9070104%40cern.ch.
> For more options, visit https://groups.google.com/d/optout.

Nacho Barrientos

unread,
Dec 2, 2014, 2:58:41 AM12/2/14
to puppet...@googlegroups.com
On 01/12/14 16:25, Spencer Krum wrote:
> Maybe you could use the notice() or warn() functions?
>

Those would log server-side, wouldn't they? I want to see it on the
client console and on the Puppet report :)

--
bye
Nacho
http://cern.ch/nacho

Henrik Lindberg

unread,
Dec 3, 2014, 10:53:51 PM12/3/14
to puppet...@googlegroups.com
On 2014-02-12 8:58, Nacho Barrientos wrote:
> On 01/12/14 16:25, Spencer Krum wrote:
>> Maybe you could use the notice() or warn() functions?
>>
>
> Those would log server-side, wouldn't they? I want to see it on the
> client console and on the Puppet report :)
>
Yes that is true. There is no current support that makes the Notify type
log its message differently.
You probably have to write such a type yourself unless you find one
someone else has written.

(Usually it is wanted to also get the location of the resource that did
the logging - why is that a problem in your case?)

--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/


Reply all
Reply to author
Forward
0 new messages