[Answered ]-Chef error in tutorial: Cannot find a resource for mysql_database on ubuntu version 10.04

2๐Ÿ‘

โœ…

Try putting these statements in your site-cookbooks/main/metadata.rb:

depends 'build-essential'
depends 'openssl' #depends on build-essential
depends 'mysql' # depends on openssl
depends 'database' #depends on mysql

I was running into the same error, and it was because Iโ€™d forgotten to add the database cookbook dependency.

After you add the database cookbook dependency, you might run into one of these errors on subsequent cooking attempts:

FATAL: Chef::Exceptions::CookbookNotFound: Cookbook aws not found.
FATAL: Chef::Exceptions::CookbookNotFound: Cookbook postgresql not found.
FATAL: Chef::Exceptions::CookbookNotFound: Cookbook xfs not found.

Thats just because the database cookbook has its own dependencies. You can add the dependent cookbooks if appropriate, or if not, just comment them out of cookbooks/database/metadata.rb:

depends "mysql", ">= 1.3.0"
# depends "postgresql", ">= 1.0.0"  
# depends "aws"  
# depends "xfs"  
๐Ÿ‘คs2t2

0๐Ÿ‘

If you check out the metadata.rb of database cookbook, you will see that it depends on some other books.

depends "mysql", ">= 1.3.0"
depends "postgresql", ">= 1.0.0"
depends "aws"
depends "xfs"

That means in order to operate, it requires these cookbooks to be also accessible. *mysql_database* is not a standard resource. It is described in mysql cookbook. (The naming convention of such resources are [cookbook_name]_[resource_name]. Seek for LWRP for more info on that.)

๐Ÿ‘คDraco Ater

Leave a comment