不能在流浪汉中使用厨师配置

时间:2015-03-26 15:05:43

标签: vagrant chef

我创建了一个基本的流浪盒和配置配置,如下所示

config.vm.provision :chef_solo do |chef|
    chef.add_recipe "apache2"
    chef.json = { :apache => { :default_site_enabled => true } }
end

我还在我的项目中添加了食谱

git submodule add https://github.com/svanzoest-cookbooks/apache2/ cookbooks/apache2

但是当我运行流浪汉时,我得到了这个

==> default: [2015-03-26T14:55:52+00:00] INFO: Forking chef instance     to converge...
==> default: [2015-03-26T14:55:52+00:00] INFO: *** Chef 12.1.2 ***
==> default: [2015-03-26T14:55:52+00:00] INFO: Chef-client pid: 1130
==> default: [2015-03-26T14:55:54+00:00] INFO: Setting the run_list to ["recipe[apache2]"] from CLI options
==> default: [2015-03-26T14:55:54+00:00] INFO: Run List is [recipe[apache2]]
==> default: [2015-03-26T14:55:54+00:00] INFO: Run List expands to [apache2]
==> default: [2015-03-26T14:55:54+00:00] INFO: Starting Chef Run for precise32
==> default: [2015-03-26T14:55:54+00:00] INFO: Running start handlers
==> default: [2015-03-26T14:55:54+00:00] INFO: Start handlers   complete.
==> default: [2015-03-26T14:55:54+00:00] ERROR: Running exception  handlers
==> default: [2015-03-26T14:55:54+00:00] ERROR: Exception handlers complete
==> default: [2015-03-26T14:55:54+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-03-26T14:55:54+00:00] ERROR: Cookbook iptables not found. If you're loading iptables from another cookbook, make sure you configure the dependency in your metadata
==> default: [2015-03-26T14:55:54+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

也许需要iptables cookbook,所以我添加它。然后我收到了这条消息

==> default: [2015-03-26T14:58:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-03-26T14:58:32+00:00] ERROR: Cookbook logrotate not found. If you're loading logrotate from another cookbook, make sure you configure the dependency in your 
==> default: [2015-03-26T14:58:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

需要logrotate食谱吗? 为什么它一直需要食谱?什么是元数据? 任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

Cookbook可以与其他cookbook有依赖关系。这使他们可以依赖这些其他烹饪书提供的功能。

在您的情况下,您的apache2食谱取决于iptableslogrotate食谱。您可以在每本食谱的metadata.rb文件中查看此内容。对于apache2 cookbook,您可以找到metadata.rb文件on GitHub

请注意,cookbook也可以具有递归依赖性,即它们可以具有必须全部满足的进一步依赖性。因为如果这样,通常建议使用BerkshelfLibrarian等工具来管理您的食谱,这些工具可以自动且一致地下载所有食谱依赖项。