我正在尝试在我的工作站上运行chef solo,以便本地应用一些设置。我的配方取决于几个外部烹饪书,我在metadata.rb和Berksfile中都指定了这些书。下面是chef-client运行失败的错误消息。
我想知道是否有一种方法可以在chef-solo运行时自动下载依赖项?
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 'you@example.com'
license 'all_rights'
description 'Installs/Configures test'
long_description 'Installs/Configures test'
version '0.1.0'
depends 'apt'