[chef] Re: Re: Conditionnally loading a MySQL database


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



On Fri, Oct 7, 2011 at 11:33 AM, Bryan McLellan < "> > wrote:
On Fri, Oct 7, 2011 at 11:21 AM, Benoit Caron < "> > wrote:
> Anybody know of a cookbook that would allow to load a SQL dump from a
> recipes, but only if the databases is still empty?

This recipe creates a database if it doesn't exist:

https://github.com/opscode/cookbooks/blob/master/wordpress/recipes/default.rb#L76


Great! 

Way more neat than what I was about to do :\
 
Also take a look at my MySQL Ruby example in this blog post for a
larger example:

http://blog.loftninjas.org/2011/02/16/the-power-of-chef-and-ruby/


The lesson learned: use the force (or ruby blocks, whichever are available).

Thanks!





Archive powered by MHonArc 2.6.16.

§