[chef] Conditionnally loading a MySQL database


Chronological Thread 
  • From: Benoit Caron < >
  • To:
  • Subject: [chef] Conditionnally loading a MySQL database
  • Date: Fri, 7 Oct 2011 11:21:30 -0400

Hello,

Anybody know of a cookbook that would allow to load a SQL dump from a recipes, but only if the databases is still empty?

The database cookbook make no reference to this, neither the mysql cookbook. 

I could load the script with an execute block calling mysql without problem, but how can I query the database to look for the missing data? The database :query action seems more made for manipulation than query, like flushing privileges but not actually reading results, am I right?

For now, I'm going to use a marker file (since it's only for development purpose), but any idea or example on how I could do that?

Thanks 

Benoit




Archive powered by MHonArc 2.6.16.

§