[chef] RE: Re: Re: Taking temporary downtime for a service


Chronological Thread 
  • From: Kevin Keane Subscription < >
  • To: < >
  • Subject: [chef] RE: Re: Re: Taking temporary downtime for a service
  • Date: Tue, 19 Mar 2013 02:02:57 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=sendgrid.info; h=subject :from:to:mime-version:content-type:in-reply-to:references :sender; q=dns; s=smtpapi; b=qw+ndAb+zlwYE+DQfs96X0XBsPUpCR85DDg q9NNswz0skVOfryNjKdta1n34PmzsX4ezO+p+oLYVsq+mmLV1P1WRW4DzQaye+MG Lk7dfPVVRIGOPyjKw7HmaOUki8BrgUZ0NT/2jM7nGfkgxfCU0pQojwBEnEPVj2L8 +SdDFPJ0=

I recently had a similar need, although for a very different use case. You can fairly easily wrap around an existing resource action by implementing a monkey patch similar to what I did here: https://github.com/kkeane/selinux/blob/master/libraries/monkeys.rb (the interesting bit starts around line 164).

 

There is a fundamental issue with wrapping the way you want it, though: you would have to predict the future when deciding whether or not to stop the service. You probably need to split the deploying into two separate parts:

 

-          Decide whether to deploy

-          Stop the service

-          Deploy

-          Start the service

 

From: Jeremy Voorhis [mailto:
Sent: Monday, March 18, 2013 5:14 PM
To:
Subject: [chef] Re: Re: Taking temporary downtime for a service

 

That's a good question. Ideally, there should be as few one-offs as possible, and while it's common for this monit-watched application to be deployed during a chef run, that is not always the case. I think what I'm looking for is some way to wrap a resource's execution with before- and after- notifications, but I don't know if it's worth the added complexity.

 

On Mon, Mar 18, 2013 at 4:54 PM, Ranjib Dey < " target="_blank"> > wrote:

is this a one off task? I am using a bunch of task that are one-offs using knife-plugins and chef-apply . Tasks that does not fit very easily into periodic chef runs / does not contribute to the overall convergence are a good fit for this. knife+chef apply combo gives you the ability to interact with chef server and also chef resource dsl. Do you want to start and stop this service in every chef run ?

 

On Mon, Mar 18, 2013 at 4:46 PM, Jeremy Voorhis < " target="_blank"> > wrote:

Hello,

 

It's common to temporarily disable a service while performing certain changes:

 

# recipe[monit::default]

service :monit do

  # ...

  action [:enable, :start]

end

 

# recipe[myapp::deploy]

service :monit do

  action [:stop]

end

 

# deploy happens ...

 

service :monit do

  action [:start]

end

 

I'd like to know if anybody has a good pattern for triggering start/stop actions for a service without duplicating the resource within a recipe. Alternative methods to achieve the same effect are welcome!

 

Thanks,

 

--

Jeremy Voorhis

 



 

--

Jeremy Voorhis




Archive powered by MHonArc 2.6.16.

§