Chef: How to run a resource on notification only

chef

I'd like to declare a resource that I want to run multiple times on notification and only on notification. How can I prevent the resource to run on its own after it is declared?

Is there some way to check if there is a notification present, so I can run something like "only_if :notified"?

Best Answer

Use action :nothing during declaration.