- From: Jon Wood <
>
- To:
- Subject: [chef] Re: developing a mysql resource
- Date: Fri, 23 Jul 2010 10:29:35 +0100
On 21 July 2010 13:56, Dmitry V'yal
<
>
wrote:
>
Unfortunately, I've run into the troubles while writing the provider action.
>
Conditional statements of the action body are evaluated before resources
>
defined above are run. For example, I can't make a test whether the database
>
is empty because It would be created later than my test and corresponding
>
'if' statement is evaluated.
>
>
I think it's a frequent problem. I'd like the hear some thoughts and advices
>
on how to avoid it.
Are you using if statements within the recipe, or only_if attributes
on the resources themselves?
Any statements which aren't within a resource block will be evaluated
during the compilation phase (shown at
http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run).
If you want to run the code while the resources are being run then you
need to wrap that code in a Ruby resource.
Archive powered by MHonArc 2.6.16.