LWRP + notification


#1

Hi all,

I have some problem with notification in LWRP.
In this example:
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


#2

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
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


#3

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 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
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


#4

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 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 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
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