I can display a custom message in two ways in Puppet, either by
notice("My extra information as a function")
or by
notify{"My extra information as a resource":}
Things in common:
Things that are different:
notify
can be set as a virtual or exported resource, with important implications, which are unavailable for notice
notice
cannot display the calling path (there is no withpath => true
)notice
has a sister function fail
, which has a power to fail the compilation of the manifest. notify
cannot do that, since it starts working when the compilation is already done. I have a feeling that I missed important aspects or maybe I was wrong in some parts. Would someone better with Puppet than me fill more details?
notify
sends a log message to the puppet agent
whereas the notice
function logs a message on the puppet server/master
in the notice
log-level. The same goes for the err
, debug
, info
, and warning
functions.
Keep in mind, notify
is a managed resource, whereas notice
is a function executed on the master.