Notify and Subscribe

Notify and Subscribe are two sides of an event triggered metaparameter, similar to how Require and Before can work together.

When a resource changes, it will Notify the specified Resource.

Or you can have a Resource Subscribe to another Resource to trigger a refresh when the Subscribed resource is changed.

As an example, this can be used to trigger a refresh (service reload/restart) after a change in a managed configuration file.

(Don’t forget that the Service and the Configuration file are considered two separate managed resources.)

Note: This only works if both Resources are being managed by Puppet. There doesn’t need to be a Notify AND a Subscribe, but both Resources need to be managed for Puppet to refresh the linked Resource.

Leave a Reply

Your email address will not be published. Required fields are marked *