2014-09-02 79 views
3

我有一個似乎與此類似的問題:Berkshelf cookbooks are not being copied to the Vagrant directory,但我相信它是不同的。流浪廚師獨奏無法訪問食譜

當我運行一個無業遊民的規定,它失敗了,聲稱它無法加載它嘗試的第一個食譜:

==> default: [2014-09-02T12:43:07+00:00] ERROR: Cookbook apt not found. If you're loading apt fr 
om another cookbook, make sure you configure the dependency in your metadata 

上的負載,我看到相應的共享文件夾進行安裝消息:

==> default: Mounting shared folders... 
    default: /var/www => D:/Rob/VMs/vdd/data 
    default: /vagrant => D:/Rob/VMs/vdd 
    default: /tmp/vagrant-chef-3/chef-solo-2/roles => D:/Rob/VMs/vdd/chef/roles 
    default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks => C:/Users/29007/.berkshelf/default/vagr 
ant/berkshelf-20140822-13996-1eqat7m-default 
    default: /tmp/vagrant-chef-3/chef-solo-3/data_bags => D:/Rob/VMs/vdd/chef/data_bags 

而且他們似乎有:

[email protected]:/tmp/vagrant-chef-3/chef-solo-1/cookbooks$ pwd 
/tmp/vagrant-chef-3/chef-solo-1/cookbooks 
[email protected]:/tmp/vagrant-chef-3/chef-solo-1/cookbooks$ ls 
apache2   chef-sugar logrotate  php   yum 
apt    database my-cookbook  postgresql yum-epel 
aws    dmg   mysql   runit  yum-mysql-community 
Berksfile.lock git   mysql-chef_gem windows 
build-essential iis   openssl   xfs 
chef_handler  iptables pacman   xml 

我的猜測是,我並不是試圖從這個位置加載它們,而是從主機上的vagrant目錄中的食譜中加載它們。但是,我也有所有這些食譜的副本(我打算對此進行配置,以便它不會依賴Berkshelf)。

這裏是我的solo.rb菜譜配置(如安裝/vagrant/chef/solo.rb):

cookbook_path ["/vagrant/chef/cookbooks/berks", "/vagrant/chef/cookbooks/core", "/vagrant/chef/cookbooks/custom"] 

這似乎是我的solo.rb文件不被讀取可能?

更新 Tensibai要求在下方留言,更完整的記錄,所以在這裏,他們是:

D:\Rob\VMs\vdd>vagrant up 
Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Checking if box 'ubuntu/trusty64' is up to date... 
==> default: Clearing any previously set forwarded ports... 
Skipping Berkshelf with --no-provision 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
    default: Adapter 2: hostonly 
==> default: Forwarding ports... 
    default: 35729 => 35729 (adapter 1) 
    default: 8983 => 8983 (adapter 1) 
    default: 22 => 2222 (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2222 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
    default: Warning: Remote connection disconnect. Retrying... 
    default: Warning: Remote connection disconnect. Retrying... 
==> default: Machine booted and ready! 
==> default: Checking for guest additions in VM... 
==> default: Configuring and enabling network interfaces... 
==> default: Mounting shared folders... 
    default: /var/www => D:/Rob/VMs/vdd/data 
    default: /vagrant => D:/Rob/VMs/vdd 
    default: /tmp/vagrant-chef-3/chef-solo-2/roles => D:/Rob/VMs/vdd/chef/roles 
    default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks => C:/Users/29007/.berkshelf/default/vagr 
ant/berkshelf-20140822-13996-1eqat7m-default 
    default: /tmp/vagrant-chef-3/chef-solo-3/data_bags => D:/Rob/VMs/vdd/chef/data_bags 
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` 
==> default: to force provisioning. Provisioners marked to run always will still run. 

D:\Rob\VMs\vdd>vagrant provision 
Updating Vagrant's berkshelf: 'C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-1399 
6-1eqat7m-default' 
Resolving cookbook dependencies... 
Fetching 'my-cookbook' from source at . 
Using apache2 (2.0.0) 
Using apt (2.5.3) 
Using aws (2.4.0) 
Using build-essential (2.0.6) 
Using chef-sugar (2.2.0) 
Using chef_handler (1.1.6) 
Using database (2.3.0) 
Using dmg (2.2.0) 
Using git (4.0.2) 
Using iis (2.1.2) 
Using iptables (0.14.0) 
Using logrotate (1.6.0) 
Using my-cookbook (0.1.0) from source at . 
Using mysql (5.4.4) 
Using mysql-chef_gem (0.0.2) 
Using openssl (2.0.0) 
Using pacman (1.1.1) 
Using php (1.4.6) 
Using postgresql (3.4.2) 
Using runit (1.5.10) 
Using windows (1.34.2) 
Using xfs (1.1.0) 
Using xml (1.2.6) 
Using yum (3.2.4) 
Using yum-epel (0.4.0) 
Using yum-mysql-community (0.1.10) 
Vendoring apache2 (2.0.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996- 
1eqat7m-default/apache2 
Vendoring apt (2.5.3) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/apt 
Vendoring aws (2.4.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/aws 
Vendoring build-essential (2.0.6) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-2014082 
2-13996-1eqat7m-default/build-essential 
Vendoring chef-sugar (2.2.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-139 
96-1eqat7m-default/chef-sugar 
Vendoring chef_handler (1.1.6) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-1 
3996-1eqat7m-default/chef_handler 
Vendoring chef_handler (1.1.6) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-1 
3996-1eqat7m-default/chef_handler 
Vendoring database (2.3.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996 
-1eqat7m-default/database 
Vendoring dmg (2.2.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/dmg 
Vendoring git (4.0.2) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/git 
Vendoring iis (2.1.2) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/iis 
Vendoring iptables (0.14.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-1399 
6-1eqat7m-default/iptables 
Vendoring logrotate (1.6.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-1399 
6-1eqat7m-default/logrotate 
Vendoring my-cookbook (0.1.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13 
996-1eqat7m-default/my-cookbook 
Vendoring mysql (5.4.4) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1e 
qat7m-default/mysql 
Vendoring mysql-chef_gem (0.0.2) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822 
-13996-1eqat7m-default/mysql-chef_gem 
Vendoring openssl (2.0.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996- 
1eqat7m-default/openssl 
Vendoring pacman (1.1.1) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1 
eqat7m-default/pacman 
Vendoring php (1.4.6) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/php 
Vendoring postgresql (3.4.2) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-139 
96-1eqat7m-default/postgresql 
Vendoring runit (1.5.10) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1 
eqat7m-default/runit 
Vendoring windows (1.34.2) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996 
-1eqat7m-default/windows 
Vendoring xfs (1.1.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/xfs 
Vendoring xml (1.2.6) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/xml 
Vendoring yum (3.2.4) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996-1eqa 
t7m-default/yum 
Vendoring yum-epel (0.4.0) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20140822-13996 
-1eqat7m-default/yum-epel 
Vendoring yum-mysql-community (0.1.10) to C:/Users/29007/.berkshelf/default/vagrant/berkshelf-20 
140822-13996-1eqat7m-default/yum-mysql-community 
==> default: Running provisioner: shell... 
    default: Running: C:/Users/29007/AppData/Local/Temp/vagrant-shell20140902-9376-m72i1a.sh 
==> default: stdin: is not a tty 
==> default: +--------------------------------------+ 
==> default: |          | 
==> default: | ooooo oooo ooooooooo ooooooooo | 
==> default: | 888 88 888 88o 888 88o | 
==> default: | 888 88 888 888 888 888 | 
==> default: |  88888  888 888 888 888 | 
==> default: |  888  o888ooo88 o888ooo88 | 
==> default: |          | 
==> default: +--------------------------------------+ 
==> default: Updating Chef to 11.12.4 version. This may take a few minutes... 
==> default: Running provisioner: chef_solo... 
Generating chef JSON and uploading... 
==> default: Running chef-solo... 
==> default: stdin: is not a tty 
==> default: [2014-09-02T23:42:57+00:00] INFO: Forking chef instance to converge... 
==> default: [2014-09-02T23:42:57+00:00] INFO: *** Chef 11.12.4 *** 
==> default: [2014-09-02T23:42:57+00:00] INFO: Chef-client pid: 3195 
==> default: [2014-09-02T23:43:05+00:00] INFO: Setting the run_list to ["role[vdd]"] from CLI op 
tions 
==> default: [2014-09-02T23:43:05+00:00] INFO: Run List is [role[vdd]] 
==> default: [2014-09-02T23:43:05+00:00] INFO: Run List expands to [apt, apache2, mysql::client, 
mysql::server, vdd::apache, vdd::graphviz, vdd::vdd_sites, vdd::php, vdd::uploadprogress, vdd:: 
mailcatcher, vdd::phpmyadmin, vdd::mysql, vdd::xdebug, vdd::git, vdd::webgrind, vdd::mc, vdd::ap 
c, vdd::rsync, vdd::curl, vdd::composer, vdd::drush, vdd::vdd_help, vdd::vim, vdd::patchutils, v 
dd::siege, vdd_example, desktop_tools] 
==> default: [2014-09-02T23:43:05+00:00] INFO: Starting Chef Run for vagrant-ubuntu-trusty-64 
==> default: [2014-09-02T23:43:05+00:00] INFO: Running start handlers 
==> default: [2014-09-02T23:43:05+00:00] INFO: Start handlers complete. 
==> default: [2014-09-02T23:43:06+00:00] ERROR: Running exception handlers 
==> default: [2014-09-02T23:43:06+00:00] ERROR: Exception handlers complete 
==> default: [2014-09-02T23:43:06+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stackt 
race.out 
==> default: [2014-09-02T23:43:06+00:00] ERROR: Cookbook apt not found. If you're loading apt fr 
om another cookbook, make sure you configure the dependency in your metadata 
==> default: [2014-09-02T23:43:06+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run p 
rocess exited unsuccessfully (exit code 1) 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 
+1

一個更大的日誌將有助於(知道運行列表和擴展的運行列表等) – Tensibai 2014-09-02 14:24:57

+0

感謝。在原始問題中增加了流浪漢和流浪者條款的輸出。請讓我知道是否還有其他任何有用的東西。 – rhuffstedtler 2014-09-02 23:45:09

+0

我可能是錯的,但向cookbook_path添加/ top/vagrant-chef-3/chef-solo-1/cookbooks可能會有所幫助。我有些事情要確認,但我確實認爲流浪貓提供的產品在/ top/vagrant-chef中生成了自己的client.rb ...(對於自動更正,抱歉)我會在工作中寫一個答案 – Tensibai 2014-09-03 06:43:40

回答

1

一些關於它的研究後,我認爲你的問題將來自HERE

的vagrant-berkshelf插件尋找一些ENV變量來獲得廚師配置,如果我正確理解它,它將覆蓋您之前使用的任何廚師獨奏配置。

查明這一切的根源,你最好的選擇將是運行與設置信息set VAGRANT_LOG=info的VAGRANT_LOG環境變量流浪漢,然後vagrant provision

你應該能夠得到生成的客戶端的確切位置.rb文件在虛擬機內檢查它並查看用於烹飪書的路徑。

希望這將有助於