Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok I'm getting started with Chef using the opscode server.

I'm using the community cookbooks, and I've got basics working (I created a users/myname.json data bag and added the user::sysadmins recipe to my node, and that works fine, the myname user is created).

I added the mysql::server receipe to the node , which installs the server fine, however, where I am stuck is configuring the servers passwords using data bags.

I created a apps/dbmaster.json data bag, with the following contents

  "mysql_root_password": {
    "_default": "strawberry"
   "mysql_repl_password": {
    "_default": "apple"

but the mysql users are set up with the default passwords. I think I'm confused on how data bags are related to nodes ? Any help appreciated.

share|improve this question
up vote 5 down vote accepted

The mysql::server recipe does not use data bags to set up the passwords by default. It uses node attributes, which get randomly generated in that recipe, unless they are present from another source such as a role.

The database::master recipe in Opscode's database cookbook will manage the attributes based on values in a data bag for an application. This cookbook is intended to be used with the application cookbook also by Opscode, for managing application deployment and configuration integration through data bags.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.