I am trying to run chef solo on my workstation to apply some settings locally. My recipe depends on several external cookbooks that I specify in both metadata.rb and Berksfile. The chef-client run fails with the error message below.
I'd like to know if there is a way to download dependencies automatically when chef-solo runs?
user@ubuntu:~/chef-solo$ chef-solo -c solo.rb -j solo.json
Starting Chef Client, version 12.8.1
Installing Cookbook Gems:
Compiling Cookbooks...
Running handlers:
[2016-03-28T16:32:36+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-03-28T16:32:36+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 03 seconds
[2016-03-28T16:32:36+00:00] FATAL: Stacktrace dumped to /home/user/chef-solo/chef-stacktrace.out
[2016-03-28T16:32:36+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-03-28T16:32:36+00:00] ERROR: Cookbook apt not found. If you're loading apt from another cookbook, make sure you configure the dependency in your metadata
solo.rb
root = File.absolute_path(File.dirname(__FILE__))
file_cache_path root
cookbook_path root + '/cookbooks'
solo.json
{
"run_list": [ "recipe[test::default]" ]
}
Berksfile
source 'https://supermarket.chef.io'
cookbook 'apt'
metadata
metadata.rb
name 'test'
maintainer 'The Authors'
maintainer_email '[email protected]'
license 'all_rights'
description 'Installs/Configures test'
long_description 'Installs/Configures test'
version '0.1.0'
depends 'apt'