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:
- Both get evaluated on Puppet Master.
- Both have access to facts.
- If message is composed from variables, both would display the same string.
Things that are different:
- The order of execution. The functions gets evaluated first, during the compilation phase. Only then the resources are fulfilled.
- The
notifycan be set as a virtual or exported resource, with important implications, which are unavailable fornotice - The
noticecannot display the calling path (there is nowithpath => true) noticehas a sister functionfail, which has a power to fail the compilation of the manifest.notifycannot 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?