Chef use of MySQL installation as a recipe

admin

Administrator
Staff member
I am looking at Chef-repo and I have a nice setup so far where I have a HA Proxy as a load blanancer connected to two wordpress servers, What I am looking to do is setup a database with a data bag in the following format passwords, passwords is abc123.

I have this data bag encrypted with a key and everything looks hunky dorey!

Now I have the latest mysql cookbook from the supermarket but I am unable to find a place to set the password during the recipe setup.

I was looking at:

<blockquote>
Then, in a recipe:
</blockquote>

Code:
mysql_service 'default' do
  port '3306'
  version '5.5'
  initial_root_password 'change me'
  action [:create, :start]
end

mysql_config 'default' do
  source 'mysite.cnf.erb'
  notifies :restart, 'mysql_service[default]'
  action :create
end

<blockquote>
Source: <a href="https://supermarket.chef.io/cookbooks/mysql" rel="nofollow">https://supermarket.chef.io/cookbooks/mysql</a>
</blockquote>

But I am very unsure were this recipe is meant to go.

Any help would be grateful.