[chef] Re: Re: Re: Re: Re: sending notifications to resources that don't exist yet


Chronological Thread 
  • From: Andrea Campi < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: sending notifications to resources that don't exist yet
  • Date: Fri, 26 Oct 2012 22:18:35 +0200



On Thu, Oct 25, 2012 at 7:22 PM, Leo Dirac (SR) < " target="_blank"> > wrote:
Hi Bryan -- here's a gist with the recipe as I finally got it working.  https://gist.github.com/3954088

I think you're probably right about why the template couldn't notify the supervisor_service -- the application recipe is complex and probably not creating the supervisor_service until convergence time.

I think I understand why the top-level `notifies` within the application didn't do anything -- that would only fire if the application resource itself changed, which basically never happens.  It's the sub-resources that are getting modified during code deployments.  Is that right?

Kinda, yeah.

I appreciate you want to keep things, the application cookbook contains a lot of magic.
However looking at your gist, it may actually be easier if you implemented an LWRP :)

You would end up with:

application "imgmuck" do
  … SCM stuff
  gunicorn do
    …
  end

  srapiworker do
    .. maybe some options
  end
end

Your hypothetical srapiworker LWRP would by kind of similar to the gunicorn or celery LWRPs in application_python—just shuffling around things from your gist.


That's the theory anyway, because you would will have this problem:

> Two parts I still really don't understand.  Why the before_restart and after_restart callbacks didn't seem to ever do anything -- never fired as far as I could see.  I even tried various chef versions from 10.12 to 10.16 on Andrea's hint.  

Again that's CHEF-3493
I just pushed a workaround to my repo [1] and sent a pull request. 
Fair warning: I've only proved that it works in test-kitchen, I don't have it running on real nodes yet :)
Still, you want to give it a whirl.

Andrea

[1] https://github.com/andreacampi/application/tree/COOK-1673




Archive powered by MHonArc 2.6.16.

§