2014-07-09 166 views
0

我想利用厨师金属和我现有的食谱和厨师回购(利用已经用于开发berkshelf和流浪者)厨师零你可以混合厨师零厨师,厨师 - 金属 - 流浪(流浪)和berkshelf?

我开始在https://github.com/opscode/chef-metal#vagrant

我得提供的示例一个vagrant_linux.rb

require 'chef_metal_vagrant' 

    vagrant_box 'CentOS-6.4-x86_64' do 
     url 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130427.box' 
    end 

    with_machine_options :vagrant_options => { 
     'vm.box' => 'CentOS-6.4-x86_64' 
    } 

我也有dev_server.rb

require 'chef_metal' 

with_chef_local_server :chef_repo_path => '~/workspace/git/my-chef-repo' 

machine 'dev_server' do 
    tag 'dev_server' 
    recipe 'myapp' 
    converge true 
end 

如果我把我的myapp食谱在〜/工作区/ git的/我的厨师回购/食谱,上面使用以下命令工作正常 ,我有一个无业游民受管理VM名为dev_server融合(应用MYAPP配方)

chef-client -z vagrant_linux.rb dev_server.rb 

但现在,我想保留我的cookbooks文件夹为空并使用berkshelf, 目前看起来并不支持厨师零支持,是吗? 我该怎么做?

+0

使用无业游民,berkshelf和无业游民厨师零插件要走的路?比照http://jeffreyrodriguez.blogspot.fr/2014/05/provisioning-vagrant-with-chef-zero-on.html – Francois

+0

我的同事一直在实施[这样的事情](https://github.com/t3dev/t3stacks),也许它可以帮助你启动并运行。 – StephenKing

+0

供参考:我将我的发现记录在我的博客http://jroller.com/francoisledroff/entry/chef_metal_experimentations_aem_test – Francois

回答

2

您可以传递:cookbook_path包含多个路径,这样一个数组:https://github.com/opscode/ec-metal/blob/master/cookbooks/ec-harness/recipes/vagrant.rb#L12-L13

with_chef_local_server :chef_repo_path => repo_path, 
    :cookbook_path => [ File.join(repo_path, 'cookbooks'), 
    File.join(repo_path, 'vendor', 'cookbooks') ] 

然后你可以使用伯克斯到供应商的上游食谱到不同的路径(供应商/食谱/),同时把你的自己的食谱到食谱/像这样:https://github.com/opscode/ec-metal/blob/master/Rakefile#L114

berks vendor vendor/cookbooks/ 
0

“berks vendor”命令是我通常如何做的 - 使用“berks供应商”并将自助购买的路径添加到您的cookbook路径。