[chef] Re: Re: Re: Re: Re: Re: Partial Convergence Support


Chronological Thread 
  • From: Greg Zapp < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Partial Convergence Support
  • Date: Tue, 24 Jun 2014 15:02:30 +1200

I'll try to expand on it a bit more :)

I have a lot of websites that need to be installed or upgraded, potentially.  They use a custom installer and this phase requires the database having already been setup or upgraded.  These database configurations are handled outside the web cluster.  The site information comes from a rest API.  A custom service runs Chef when a cluster change is reflect in the API. This service also records the timestamp of the most recent resource from the remote API when Chef has fully converged the node.  It will run Chef again if the remote API indicates the cluster has changed.

This all works well however I'm looking to improve one aspect: Sites whose databases are not ready currently end the run.  This blocks other site's resources from being processed and is not very efficient.  So, I want to skip those sites and indicate that the node is "partially converged" to my service that runs Chef so that it knows the node is not fully converged and can run it again until it is.

The two most direct methods I can think of involve a custom report handler that can tell if something was postponed/skipped/etc.  If so it could:
A.) Exit Chef with a custom exit code
B.) Print something to stdout that will be parsed

I'm curious if anyone knows of such a handler, or has any experience in implementing an N-run converge setup.

Cheers,
   -Greg


On Tue, Jun 24, 2014 at 12:55 PM, Adam Jacob < " target="_blank"> > wrote:
I don't understand what you're trying to accomplish. :) Can you give us more of a use case?


On Mon, Jun 23, 2014 at 5:46 PM, Greg Zapp < " target="_blank"> > wrote:
Hi Adam,

Are you aware of any built-in way to indicate it has not completed without throwing an exception or otherwise stopping the run?

Thanks,
   -Greg


On Tue, Jun 24, 2014 at 12:41 PM, Adam Jacob < " target="_blank"> > wrote:

A non zero exit code does exactly that in Chef. If it is completed, we return 0.

On Jun 23, 2014 4:18 PM, "Greg Zapp" < " target="_blank"> > wrote:
Non-zero exit codes do not necessarily, or do not have to, indicate an error.  

I'm trying to accomplish Chef finishing and indicating it has not fully converged the node.  I apologize if that wasn't clear in my original post.

-Greg


On Tue, Jun 24, 2014 at 11:08 AM, Noah Kantrowitz < " target="_blank"> > wrote:
It should exit with a non zero code if there is an error, what are you trying to accomplish!


On June 23, 2014 3:59:17 PM PDT, Greg Zapp < " target="_blank"> > wrote:
Hello,

Is anyone aware of a handler, or a technique in use, for indicating that Chef has not successfully converged the node?

I'm considering writing a custom handler that will check an "unfinished" flag and either kill chef with a custom exit code( :| ) or write something to stdout that I can look for.


Cheers,
   -Greg





--




Archive powered by MHonArc 2.6.16.

§