2017-02-20 58 views
1

我收到的时候我尝试使用到provion我的VM此错误流浪汉,厨师:厨师:没有这样的菜谱

==> default: ==================================== 
==> default: Error Resolving Cookbooks for Run List: 
==> default: ==================================== 
==> default: 
==> default: Missing Cookbooks: 
==> default: ------------------ 
==> default: No such cookbook: windows 
==> default: 
==> default: Expanded Run List: 
==> default: ------------------ 
==> default: * java 
==> default: 
==> default: Platform: 
==> default: --------- 
==> default: x86_64-linux 
==> default: 

我的无业游民结构为:

VagrantFile 
├───chef 
│ ├───cookbooks 
│ │ ├───apt 
│ │ ├───java 
│ ├───roles 
│ │ ├───java-dev-workstation.rb 

Vagrantfile含量:

Vagrant.configure("2") do |config| 
    config.vm.box = "centos/7" 
    config.vm.provision "chef_solo" do |chef| 
    chef.roles_path = "chef/roles" 
    chef.cookbooks_path = "chef/cookbooks" 
    chef.add_role "java-dev-workstation" 
    end 
end 

而且java-dev-workstation.rb

name "java-dev-workstation" 

default_attributes( 
    # Because it's Oracle, we need to agree to the terms and conditions. 
    :java => { 
    :install_flavor => 'oracle', 
    :jdk_version => '8', 
    :accept_license_agreement => true, 
    :oracle => { "accept_oracle_download_terms" => true } 
    } 

) 

run_list(
    "recipe[java]" 
) 

我使用厨师12.18.31。

任何想法?

回答

1

java食谱取决于windows食谱,你没有下载,所以它不能继续。这就是为什么人们会自动为你自动使用Berkshelf或Policyfile系统作为这两种下载依赖关系的原因。

并回答您可能的下一个问题:是的,即使您没有使用Windows虚拟机,您仍需要依赖项,但我们没有任何方法来执行可选的依赖项。

0

同意以前的评论。所以,不要添加所有的依赖手动使用无业游民,berkshelf插件 - https://github.com/berkshelf/vagrant-berkshelf

所有你需要做的:

  1. 申报所有的依赖关系(在你的情况下,它仅仅是java的食谱,berkshelf会照顾默默地关于cookbooks java cookbook取决于 - windows,等等..)在正确的Berksfile中
  2. 在你的Vagrantfile中指向一个Berksfile位置