[chef] Re: Re: mysql-0.23 cookbook fails on Lucid


Chronological Thread 
  • From: Dmitry V'yal < >
  • To:
  • Cc: Joshua Timberman < >
  • Subject: [chef] Re: Re: mysql-0.23 cookbook fails on Lucid
  • Date: Thu, 15 Jul 2010 22:57:46 +0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=gRvkv5DSduL/zPW3V+NRvG+YC38UjzceA8TmGV2WRaf0OLSoIkc3K7f9abi/mh0yk8 J65KIEqhUHZFqiiYLtlkeEACcRM9ptIWctQimgxl54VbulZn0/dssy7Rfuhi3K7yUzTT yTd5rjxs0IRHeA7M1w4EFfGL65EbQdo6sjZuw=

On 15.07.2010 19:58, Joshua Timberman wrote:

Recall that the Chef client run processes recipes in two phases[0] - the 
compile phase and the execution phase. During the compile phase your Ruby 
code is processed:

r1 = package "ruby1.8-dev"
r1.run_action(:install)

So this gets evaluated and the resource is created and the package installed. 
The mysql cookbook uses this 'trick' to ensure the mysql gem can be installed 
and later used in the mysql cookbook's library in the same Chef client run.

The build-essential and ruby cookbooks do not do this (the Opscode Ruby 
cookbook installs the ruby dev package, so you can use that). They create the 
package resources during the compile phase as normal but Chef doesn't 
actually run the package installation until the execution phase. You should 
modify your local copy of the build-essential recipe to have the following 
block for the package installation:

Thanks a lot, seems I got it. Are there other cookbooks exploiting the similar idea?

Dmitry



Archive powered by MHonArc 2.6.16.

§