[chef] Re: dependency issue with cookbook that uses gem with native code


Chronological Thread 
  • From: millisami r < >
  • To: chef < >
  • Subject: [chef] Re: dependency issue with cookbook that uses gem with native code
  • Date: Mon, 18 Nov 2013 09:37:10 +0545

@Eric, I guess after including the build-essential recipe, you have to set the 

node['build_essential']['compiletime'] = true

to tell chef to install at the compile phase.



@millisami
~Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com


On Mon, Nov 18, 2013 at 6:05 AM, Eric Swenson < " target="_blank"> > wrote:
I'm trying to provision a server with a cookbook that uses the mysql_database resource from the database cookbook.  This cookbook depends on the mysql cookbook, which requires building due to references to native code (e.g. libmysqlclient).  In trying to bootstrap a brand new node, which doesn't have gcc (and other build-essential components), I cannot get past the error:

Error executing action `install` on resource 'chef_gem[mysql]'

My cookbook has a "depends" statement for the "database" cookbook.  And that cookbook has a dependency on "mysql". Prior to executing any of the recipes in any of the defined cookbook, chef-client tries to compile the cookbooks it knows it needs.  It can't build the "mysql" cookbook because gcc is not yet installed. While I've added "recipe[build-essential]" to the head of my run_list for the role, chef-client never gets this far, as it wants to compile all cookbooks in the dependency list prior to executing any of the recipes in the run list.

How do I get around this?   I want to bootstrap a node that doesn't have gcc installed (yet).  How do I get chef-client to install the build-essential package BEFORE compiling cookbooks?

-- Eric




Archive powered by MHonArc 2.6.16.

§