Chef run_status for individual cookbooks


#1

I’ve configured a machine as chef-solo and I executed chef-solo with a set of
cookbooks along with a report handler which will send mail about the run_status
(success or failed) of chef-solo execution. The problem here is if I ran three
cookbooks say apache,java and mysql and apache,java installed successfully and
mysql got failed.In this case,I’m getting the whole run_status as failed
eventhough two cookbooks installed successfully. Instead of getting the whole
status, Is there any method to retrieve the successfully installed cookbooks
and the cookbooks that failed to execute?


#2

The divisions between cookbooks and/or recipes don’t really exist once all the resources are loaded. There is just a list of resource objects in the collection and Chef converges them in order. You could try to reverse-engineer the information you are looking for since each resource does track what recipe it was defined in, but this isn’t directly available.

—Noah

On Jul 13, 2014, at 11:51 PM, nagalakshmi.n@cloudenablers.com wrote:

I’ve configured a machine as chef-solo and I executed chef-solo with a set of
cookbooks along with a report handler which will send mail about the run_status
(success or failed) of chef-solo execution. The problem here is if I ran three
cookbooks say apache,java and mysql and apache,java installed successfully and
mysql got failed.In this case,I’m getting the whole run_status as failed
eventhough two cookbooks installed successfully. Instead of getting the whole
status, Is there any method to retrieve the successfully installed cookbooks
and the cookbooks that failed to execute?


#3

Additionally, I’d want to understand a bit more about your use case. Chef
works in a test-and-repair mode so all of your cookbooks should be able to
be applied multiple times without causing any harm. If no changes are
required to bring Chef in-line with the policy you’ve specified, Chef will
not make any changes.

On Mon, Jul 14, 2014 at 6:24 AM, Noah Kantrowitz noah@coderanger.net
wrote:

The divisions between cookbooks and/or recipes don’t really exist once all
the resources are loaded. There is just a list of resource objects in the
collection and Chef converges them in order. You could try to
reverse-engineer the information you are looking for since each resource
does track what recipe it was defined in, but this isn’t directly available.

—Noah

On Jul 13, 2014, at 11:51 PM, nagalakshmi.n@cloudenablers.com wrote:

I’ve configured a machine as chef-solo and I executed chef-solo with a
set of
cookbooks along with a report handler which will send mail about the
run_status
(success or failed) of chef-solo execution. The problem here is if I ran
three
cookbooks say apache,java and mysql and apache,java installed
successfully and
mysql got failed.In this case,I’m getting the whole run_status as failed
eventhough two cookbooks installed successfully. Instead of getting the
whole
status, Is there any method to retrieve the successfully installed
cookbooks
and the cookbooks that failed to execute?