Chef Solo error: Cookbook apt not found

﹥>﹥吖頭↗ 提交于 2019-12-05 07:21:09

The error is pretty descriptive. You likely have a cookbook in your runlist that has depends apt in its metadata.rb file.

Luckily, this easy to resolve - just include the apt cookbook (https://github.com/opscode-cookbooks/apt) in your cookbooks folder and call it in your runlist (or role, when you get to that level).

Karishma Malkan

If you are using chef-solo, make sure your solo.rb points to the correct cookbook location. I had set it as :

cookbook_path "/root/chef-repo/cookbooks"

instead of:

cookbook_path "/home/ubuntu/chef-repo/cookbooks"
Tobias Sjösten

Karishma is correct in her answer, though I would like to expand on it and make it more dynamic by skipping the 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 to be wherever you place the solo.rb file.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!