# LWRP + notification

**URL:** <https://discourse.chef.io/t/lwrp-notification/4328>\
**Category:** Chef Infra (archive)\
**Created:** [August 19, 2013, 2:37pm UTC](https://discourse.chef.io/t/lwrp-notification/4328 "2013-08-19T14:37:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guilhem\_Lettron](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/guilhem_lettron/32/37_2.png) [@Guilhem\_Lettron](https://discourse.chef.io/u/Guilhem_Lettron)\
**Post date:** [August 19, 2013, 2:37pm UTC](https://discourse.chef.io/t/lwrp-notification/4328/1 "2013-08-19T14:37:04Z")

</div>

Hi all,

I have some problem with notification in LWRP.  
In this example:  
[https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb](https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb)  
Notifications don’t work as I expect.

For example, I want to update a configuration file when I add a module.  
Template resource is defined in an install recipe and I want to notifies it  
to take care of modification by LWRP. (I can’t use something like ".d"  
folder).  
I also want to restart service and I don’t want to duplicate service code  
(because service can be upstart / init / something else, and this code is  
manage in a different recipe). So a notification on "service[prosody]"  
define in a “service” recipe is something great… I can’t use…

I try with use\_inline\_resources and without.

Can I do something else? Or Am I wrong somewhere?

Latest chef version installed.

Thank you.

Guilhem Lettron

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [August 19, 2013, 2:44pm UTC](https://discourse.chef.io/t/lwrp-notification/4328/2 "2013-08-19T14:44:49Z")

</div>

On Monday, August 19, 2013 at 7:37 AM, Guilhem Lettron wrote:

> Hi all,
> 
> I have some problem with notification in LWRP.  
> In this example: [https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb](https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb)  
> Notifications don't work as I expect.
> 
> For example, I want to update a configuration file when I add a module.  
> Template resource is defined in an install recipe and I want to notifies it to take care of modification by LWRP. (I can't use something like ".d" folder).  
> I also want to restart service and I don't want to duplicate service code (because service can be upstart / init / something else, and this code is manage in a different recipe). So a notification on "service[prosody]" define in a "service" recipe is something great... I can't use...
> 
> I try with use\_inline\_resources and without.
> 
> Can I do something else? Or Am I wrong somewhere?
> 
> Latest chef version installed.  
> When using `use_inline_resources`, your LWRPs execute in a self-contained chef run with each action having an independent compile/converge phase and resource collection. To do what you want, just have the LWRP resource in your recipe notify the template resource.

> Thank you.
> 
> Guilhem Lettron

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Guilhem\_Lettron](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/guilhem_lettron/32/37_2.png) [@Guilhem\_Lettron](https://discourse.chef.io/u/Guilhem_Lettron)\
**Post date:** [August 19, 2013, 3:44pm UTC](https://discourse.chef.io/t/lwrp-notification/4328/3 "2013-08-19T15:44:15Z")

</div>

Thank you for this answer, but I don't understand what you mean by "LWRP  
resource in your recipe notify the template resource".

Guilhem Lettron

On Mon, Aug 19, 2013 at 4:44 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Monday, August 19, 2013 at 7:37 AM, Guilhem Lettron wrote:
> 
> Hi all,
> 
> I have some problem with notification in LWRP.  
> In this example:  
> [https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb](https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb)  
> Notifications don't work as I expect.
> 
> For example, I want to update a configuration file when I add a module.  
> Template resource is defined in an install recipe and I want to notifies  
> it to take care of modification by LWRP. (I can't use something like ".d"  
> folder).  
> I also want to restart service and I don't want to duplicate service code  
> (because service can be upstart / init / something else, and this code is  
> manage in a different recipe). So a notification on "service[prosody]"  
> define in a "service" recipe is something great... I can't use...
> 
> I try with use\_inline\_resources and without.
> 
> Can I do something else? Or Am I wrong somewhere?
> 
> Latest chef version installed.
> 
> When using `use_inline_resources`, your LWRPs execute in a self-contained  
> chef run with each action having an independent compile/converge phase and  
> resource collection. To do what you want, just have the LWRP resource in  
> your recipe notify the template resource.
> 
> Thank you.
> 
> Guilhem Lettron
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Guilhem\_Lettron](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/guilhem_lettron/32/37_2.png) [@Guilhem\_Lettron](https://discourse.chef.io/u/Guilhem_Lettron)\
**Post date:** [August 19, 2013, 3:54pm UTC](https://discourse.chef.io/t/lwrp-notification/4328/4 "2013-08-19T15:54:58Z")

</div>

I'm dumb, I find the problem... "notifies" wasn't at the good place...

Thanks

Guilhem Lettron

On Mon, Aug 19, 2013 at 5:44 PM, Guilhem Lettron [guilhem@lettron.fr](mailto:guilhem@lettron.fr) wrote:

> Thank you for this answer, but I don't understand what you mean by "LWRP  
> resource in your recipe notify the template resource".
> 
> Guilhem Lettron
> 
> On Mon, Aug 19, 2013 at 4:44 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> > On Monday, August 19, 2013 at 7:37 AM, Guilhem Lettron wrote:
> > 
> > Hi all,
> > 
> > I have some problem with notification in LWRP.  
> > In this example:  
> > [https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb](https://github.com/optiflows-cookbooks/prosody/blob/LWRP/providers/module.rb)  
> > Notifications don't work as I expect.
> > 
> > For example, I want to update a configuration file when I add a module.  
> > Template resource is defined in an install recipe and I want to notifies  
> > it to take care of modification by LWRP. (I can't use something like ".d"  
> > folder).  
> > I also want to restart service and I don't want to duplicate service code  
> > (because service can be upstart / init / something else, and this code is  
> > manage in a different recipe). So a notification on "service[prosody]"  
> > define in a "service" recipe is something great... I can't use...
> > 
> > I try with use\_inline\_resources and without.
> > 
> > Can I do something else? Or Am I wrong somewhere?
> > 
> > Latest chef version installed.
> > 
> > When using `use_inline_resources`, your LWRPs execute in a self-contained  
> > chef run with each action having an independent compile/converge phase and  
> > resource collection. To do what you want, just have the LWRP resource in  
> > your recipe notify the template resource.
> > 
> > Thank you.
> > 
> > Guilhem Lettron
> > 
> > --  
> > Daniel DeLeo
