Opscode MySQL cookbook

Hi,

I’m trying to set up an application to deploy using Chef, and I’m
having some trouble with the MySQL cookbook from the Opscode
repository when including the mysql::client recipe on first run. The
client recipe has the following running under Ubuntu:

gem_package “mysql” do
action :nothing
end

r.run_action(:install)

That fails on the first run using my base image, because at the point
that the cookbook gets loaded and attempts to install the mysql gem I
don’t have ruby1.8-dev installed yet. The ruby cookbook is being
included in a default role applied to all nodes, but doesn’t get a
chance to run in time.

Is there a particular reason for forcing both the gem and mysql-devel
to be installed immediately, rather then respecting my run list’s
order?

Cheers,
Jon

Hi Jon,
As you probably know, the "run_action hack" is usually used to install
a gem and then use it later in the recipe. In this case, it doesn't
look like we're taking advantage of this any more. You can see that
the cookbook provides LWRP for flushing and unlocking MySQL tables,
but they don't appear to be used in the recipe itself.

Feel free to file a bug or submit a patch.

Dan DeLeo

On Fri, Apr 30, 2010 at 4:12 AM, Jon Wood jon@blankpad.net wrote:

Hi,

I'm trying to set up an application to deploy using Chef, and I'm
having some trouble with the MySQL cookbook from the Opscode
repository when including the mysql::client recipe on first run. The
client recipe has the following running under Ubuntu:

gem_package "mysql" do
action :nothing
end

r.run_action(:install)

That fails on the first run using my base image, because at the point
that the cookbook gets loaded and attempts to install the mysql gem I
don't have ruby1.8-dev installed yet. The ruby cookbook is being
included in a default role applied to all nodes, but doesn't get a
chance to run in time.

Is there a particular reason for forcing both the gem and mysql-devel
to be installed immediately, rather then respecting my run list's
order?

Cheers,
Jon

Thanks Dan,

I don't seem to be able to connect to tickets.opscode.com right now,
but once I can I'll submit a patch to change that behaviour.

Jon

On 3 May 2010 07:19, Daniel DeLeo dan@kallistec.com wrote:

Hi Jon,
As you probably know, the "run_action hack" is usually used to install
a gem and then use it later in the recipe. In this case, it doesn't
look like we're taking advantage of this any more. You can see that
the cookbook provides LWRP for flushing and unlocking MySQL tables,
but they don't appear to be used in the recipe itself.

Feel free to file a bug or submit a patch.

Dan DeLeo

On Fri, Apr 30, 2010 at 4:12 AM, Jon Wood jon@blankpad.net wrote:

Hi,

I'm trying to set up an application to deploy using Chef, and I'm
having some trouble with the MySQL cookbook from the Opscode
repository when including the mysql::client recipe on first run. The
client recipe has the following running under Ubuntu:

gem_package "mysql" do
action :nothing
end

r.run_action(:install)

That fails on the first run using my base image, because at the point
that the cookbook gets loaded and attempts to install the mysql gem I
don't have ruby1.8-dev installed yet. The ruby cookbook is being
included in a default role applied to all nodes, but doesn't get a
chance to run in time.

Is there a particular reason for forcing both the gem and mysql-devel
to be installed immediately, rather then respecting my run list's
order?

Cheers,
Jon