Help using chef community mysql cookbook for idempotent chef-client runs

I’m been working my way through using various chef community cookbooks, but
I’m a little stuck on using the mysql cookbook.

I can install the MySQL service fine, but I’m having trouble with creating
users and database(s) in a way that’s idempotent once the users and
databases are there.

Also, is there a way to import a schema or an existing database dump file
that I have copied to the client from the chef server?

Thanks for any suggestions.

Eric Feldhusen

Hey Eric,
Have you tried checking out the database cookbook?

There are LWRPs that should help you do what you are looking to do.

Tom Duffield — Automation Consulting Engineer

651.769.7497 – tom@opscode.com – *my:
*Linkedinhttp://www.linkedin.com/in/thomasduffield/
Twitter https://twitter.com/tomduffield

OPSCODE

CODE CAN
opscode.com http://www.opscode.com Blog http://www.opscode.com/blog/
Facebook http://www.facebook.com/opscode
Twitterhttp://www.twitter.com/opscode
YouTube http://www.youtube.com/opscode

On Mon, Oct 28, 2013 at 9:26 AM, Eric Feldhusen
efeldhusen.lists@gmail.comwrote:

I'm been working my way through using various chef community cookbooks,
but I'm a little stuck on using the mysql cookbook.

I can install the MySQL service fine, but I'm having trouble with creating
users and database(s) in a way that's idempotent once the users and
databases are there.

Also, is there a way to import a schema or an existing database dump file
that I have copied to the client from the chef server?

Thanks for any suggestions.

Eric Feldhusen

28.10.2013 18:26, Eric Feldhusen ?????:

I'm been working my way through using various chef community
cookbooks, but I'm a little stuck on using the mysql cookbook.

I can install the MySQL service fine, but I'm having trouble with
creating users and database(s) in a way that's idempotent once the
users and databases are there.

Also, is there a way to import a schema or an existing database dump
file that I have copied to the client from the chef server?

Thanks for any suggestions.

Eric Feldhusen
You can see this example:

--
Best regards,

CVision Lab System Administrator
Vladmir Skubriev

I'm still figuring out the LWRP's.

Eric

On Mon, Oct 28, 2013 at 10:32 AM, Tom Duffield tom@opscode.com wrote:

Hey Eric,
Have you tried checking out the database cookbook?
GitHub - chef-boneyard/database: DEPRECATED: Development repository for Chef database cookbook

There are LWRPs that should help you do what you are looking to do.

Tom Duffield — Automation Consulting Engineer

651.769.7497 – tom@opscode.com – *my: *Linkedinhttp://www.linkedin.com/in/thomasduffield/
Twitter https://twitter.com/tomduffield

OPSCODE

CODE CAN
opscode.com http://www.opscode.com Bloghttp://www.opscode.com/blog/
Facebook http://www.facebook.com/opscode Twitterhttp://www.twitter.com/opscode
YouTube http://www.youtube.com/opscode

On Mon, Oct 28, 2013 at 9:26 AM, Eric Feldhusen <
efeldhusen.lists@gmail.com> wrote:

I'm been working my way through using various chef community cookbooks,
but I'm a little stuck on using the mysql cookbook.

I can install the MySQL service fine, but I'm having trouble with
creating users and database(s) in a way that's idempotent once the users
and databases are there.

Also, is there a way to import a schema or an existing database dump file
that I have copied to the client from the chef server?

Thanks for any suggestions.

Eric Feldhusen

Here is a sample of how I use a definition and the databases cookbook to handle creating multiple databases/users:

Justin

-----Original Message-----
From: “Eric Feldhusen” efeldhusen.lists@gmail.com
Sent: Tuesday, October 29, 2013 12:01pm
To: chef@lists.opscode.com
Subject: [chef] Re: Re: Help using chef community mysql cookbook for idempotent chef-client runs

I’m still figuring out the LWRP’s.
Eric

On Mon, Oct 28, 2013 at 10:32 AM, Tom Duffield <[mailto:tom@opscode.com] tom@opscode.com> wrote:

Hey Eric,
Have you tried checking out the database cookbook? [https://github.com/opscode-cookbooks/database] https://github.com/opscode-cookbooks/database
There are LWRPs that should help you do what you are looking to do.

Tom Duffield — Automation Consulting Engineer
651.769.7497 – [mailto:tom@opscode.com] tom@opscode.com – my: [http://www.linkedin.com/in/thomasduffield/] Linkedin [https://twitter.com/tomduffield] Twitter

OPSCODE
CODE CAN
[http://www.opscode.com] opscode.com [http://www.opscode.com/blog/] Blog [http://www.facebook.com/opscode] Facebook [http://www.twitter.com/opscode] Twitter [http://www.youtube.com/opscode] YouTube

On Mon, Oct 28, 2013 at 9:26 AM, Eric Feldhusen <[mailto:efeldhusen.lists@gmail.com] efeldhusen.lists@gmail.com> wrote:

I’m been working my way through using various chef community cookbooks, but I’m a little stuck on using the mysql cookbook.
I can install the MySQL service fine, but I’m having trouble with creating users and database(s) in a way that’s idempotent once the users and databases are there.
Also, is there a way to import a schema or an existing database dump file that I have copied to the client from the chef server?
Thanks for any suggestions.
Eric Feldhusen