Chef Solo Error: Cookbook apt not found

Hy I'm trying to run a MongoDB recipe with a Solo chef on Amazon EC2 Linux AMI. I installed Omnibus, set the cookbook path in the .rb file, and runlist in the .json file. I copied the contents of the mongodb recipe zip file from github to the cookbook folder and ran the chef-solo command. The result is below:

FATAL: Chef :: Exceptions :: CookbookNotFound: Cookbook apt not found. If you are loading apt from another cookbook, make sure you configure the dependency in your metadata

I'm also pretty new to Linux, what am I doing wrong here?

+6
source share
4 answers

The error is quite descriptive. Your task list probably has a cookbook with depends apt in the metadata.rb file.

Fortunately, this is easy to resolve - just include the apt cookie ( https://github.com/opscode-cookbooks/apt ) in your cookbooks folder and call it on your list (or role when you get to this level).

+7
source

If you use chef-solo , make sure your solo.rb points to the correct cookbook folder. I installed it as:

 cookbook_path "/root/chef-repo/cookbooks" 

instead:

 cookbook_path "/home/ubuntu/chef-repo/cookbooks" 
+10
source

Karishma is true in her answer , although I would like to expand it and make it more dynamic, skipping absolute paths. Here is my implementation:

 root = File.absolute_path(File.dirname(__FILE__)) file_cache_path root cookbook_path root + '/cookbooks' 

It sets the paths wherever you place the solo.rb file.

+2
source

This happened to me because I forgot to run librarian-chef install !

+2
source

All Articles