2014-03-06 137 views
2

使用廚師獨奏,我試圖啓動一個安裝git的簡單虛擬機。向廚師食譜添加依賴項

我有一個「cookbooks」目錄,以及一個Vagrantfile。

-cookbooks  
-Vagrantfile 

Vagrantfile

# -*- mode: ruby -*- 
# vi: set ft=ruby : 

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 
VAGRANTFILE_API_VERSION = "2" 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 

    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "centos_64" 

    config.vm.network "forwarded_port", guest: 80, host: 8085 
    config.omnibus.chef_version = :latest 

    ... 

    config.vm.provision :chef_solo do |chef| 
    chef.add_recipe "build-essential" 
    chef.add_recipe "dmg" 
    chef.add_recipe "yum" 
    chef.add_recipe "git" 
    end 
end 

我克隆git食譜我的食譜目錄。但是,我遇到了一個問題:

[2014-03-06T21:09:58+00:00] ERROR: Cookbook runit not found. If you're loading 
runit from another cookbook, make sure you configure the dependency in your 
metadata 
[2014-03-06T21:09:58+00:00] FATAL: Chef::Exceptions::ChildConvergeError: 
Chef run process exited unsuccessfully (exit code 1) 

不是continuining更多食譜依賴添加到我的Vagrantfile,有什麼處理的依賴關係的正確方法?

回答

2

結賬http://berkshelf.com。它允許你創建一個Berksfile來指定你需要的gem,並處理依賴關係解析。