[chef] Re: How to manage databases with chef?


Chronological Thread 
  • From: Seth Thomas < >
  • To:
  • Subject: [chef] Re: How to manage databases with chef?
  • Date: Tue, 19 Aug 2014 09:31:44 -0700

Coordination as such isn't required - all you need to make sure of is that MySQL is installed on the DB server and has the user setup before initializing owncloud. There are several ways to do this but here is one possible way:

1. Run the mysql::server recipe [1] on the DB server (if mysql is not already installed) and have it create your user
2. Have the owncloud recipe include a "mysql_database" resource block that creates the owncloud DB using the user creds
3. Let the owncloud recipe do the rest

There is prior work here so I'd give this repo [2] a look but note that it assumes that the database is on localhost. It should be easy enough to fork or create your own cookbook. As for protecting secrets one could use encrypted databags/chef-vault/citadel but that is easily it's own discussion [3].


Cheers,
Seth Thomas


On Tue, Aug 19, 2014 at 4:35 AM, < " target="_blank"> > wrote:

What are some best practices for coordinating cookbooks on several different servers? In my example, I have an application (owncloud) that also needs to create a database on another (MySQL) server. I do not want to allow remote root access to that MySQL server.

 

So the process should be something along the lines of:

 

-          On owncloud server: chef-client install owncloud binaries and somehow communicates with chef-client on the database server

-          On db server: create owncloud database and a user to access this database and communicates the user name and password back.

-          On owncloud server: continue owncloud configuration

 

How is this type of scenario best handled in chef?

 

Thanks!

 





Archive powered by MHonArc 2.6.16.

§