Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notify in verbose or debug mode only

Tags:

puppet

I'm looking for a way to display a notify { ... } message during puppet client run only when using

  • puppet apply <--verbose | --debug>
  • puppet agent <--verbose | --debug>

I'd like to display debug messages when interactively/manually running puppet on clients. Yet, I couldn't find a way to evaluate these switches in my puppet manifests. How could I achieve this for puppet 4.x?

like image 534
ITL Avatar asked Sep 16 '15 08:09

ITL


1 Answers

All Puppet resources support the loglevel metaparameter, including notify. Set it to debug to make a resource report on that level.

notify { "this is a debug message": loglevel => "debug" }

Output from such resources is hidden by default.

The verbose option does not imply a specific log level.

like image 53
Felix Frank Avatar answered Oct 04 '22 21:10

Felix Frank