# "notify" on any change made in an include\_recipe call

**URL:** <https://discourse.chef.io/t/notify-on-any-change-made-in-an-include-recipe-call/6945>\
**Category:** Chef Infra (archive)\
**Created:** [September 29, 2015, 8:53pm UTC](https://discourse.chef.io/t/notify-on-any-change-made-in-an-include-recipe-call/6945 "2015-09-29T20:53:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [September 29, 2015, 8:53pm UTC](https://discourse.chef.io/t/notify-on-any-change-made-in-an-include-recipe-call/6945/1 "2015-09-29T20:53:43Z")

</div>

I’ve never seen any code to do this, so I figured I’d throw it out there  
as a question in case there’s some crazy existing way to solve it.

Cookbook reuse… Community cookbooks…

Is something like the following idea possible? Or is the lack of ability  
to do the following one of the reasons for the new-headed resource-heavy  
cookbook design push[1]?

include\_recipe ‘java’ do  
notifies :restart, ‘service[myjava-service]’, :immediately  
end

Footnotes:

1. java “8” do  
notifies :restart, ‘service[myjava-service]’, :immediately  
end

---

<div class="post-metadata">

**Author:** ![Lamont\_Granquist](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@Lamont\_Granquist](https://discourse.chef.io/u/Lamont_Granquist)\
**Post date:** [September 29, 2015, 9:15pm UTC](https://discourse.chef.io/t/notify-on-any-change-made-in-an-include-recipe-call/6945/2 "2015-09-29T21:15:35Z")

</div>

Nope, include\_recipe is a compile-time hack more like #include than a  
resource.

If we had resources that were recipes you might be able to do something  
like that (in fact that is an excellent requirement for  
recipes-as-resources as a feature).

On 09/29/2015 01:53 PM, Jeff Blaine wrote:

> I've never seen any code to do this, so I figured I'd throw it out there  
> as a question in case there's some crazy existing way to solve it.
> 
> Cookbook reuse... Community cookbooks...
> 
> Is something like the following idea possible? Or is the lack of ability  
> to do the following one of the reasons for the new-headed resource-heavy  
> cookbook design push[1]?
> 
> include\_recipe 'java' do  
> notifies :restart, 'service[myjava-service]', :immediately  
> end
> 
> Footnotes:
> 
> 1. java "8" do  
> notifies :restart, 'service[myjava-service]', :immediately  
> end
