[chef-dev] Re: Resource requirements for an Idempotent resource


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: Kishore S Kumar < >
  • Cc: chef-dev < >
  • Subject: [chef-dev] Re: Resource requirements for an Idempotent resource
  • Date: Mon, 10 Dec 2012 09:38:14 -0800


On Sunday, December 9, 2012 at 10:25 PM, Kishore S Kumar wrote:

Hi,

I'm trying to understand how resource requirements work with idempotent resource. Can someone help me. Currently I have a idempotent resource which say install a software unless it is already installed. I have resource requirement assertion set for the action which fail if the installer does not exist.
What should have happened  when I try to run the recipe on a node where the software is already installed(idempotency) and the installer does not exist(resource requirements failed). 

right now the recipe fails saying the resource requirements failure.

Thanks
Kishore
Full explanation of what resource requirements are and do here: https://github.com/opscode/chef/blob/master/lib/chef/mixin/why_run.rb#L63-123

Short version is that they are for implementing why-run's precondition detection and assumption behavior. The canonical example is the case where you have a service that's not installed yet. Since chef can't query the init script to see if the service is running, it can't give any realistic information about whether a service would be started, so it emits a warning and then proceeds assuming the action would have been run.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§