Vagrant と Chef を使い始めたばかりですが、非常に奇妙なエラーだと思います。
単純な VM とシェフなしですべて問題ありませんが、いくつかのレシピを貼り付けると失敗します。
Vagrantfile から呼び出されるメイン レシピの現在の default.rb を次に示します。主にこのブログ/チュートリアルから
r = execute "apt-get update" do
user "root"
command "apt-get update"
action :nothing
end
r.run_action(:run)
include_recipe "php"
include_recipe "apache2"
include_recipe "mysql"
php apache2 と mysql のレシピは、opscode コミュニティ サイトから直接入手したものです。
これらのレシピの 1 つを入れるだけで、問題なく読み込まれます。場合によっては 2 つでも問題ありませんが、3 つすべてを入力すると、最後のいずれかでエラーが発生するようです。注文ラウンドを変更しましたが、エラーの原因は常に最後のラウンドです。エラーは次のとおりです。毎回同じですが、この場合、php は 3 つのうちの最後であり、インストールに失敗していることがわかります。
[default] [Fri, 06 Jan 2012 10:01:33 -0800] INFO: Processing package[php5] action install (php::package line 32)
: stdout
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: package[php5] (php::package line 32) has had an error
: stdout
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: Running exception handlers
: stdout
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: Exception handlers complete
: stdout
[default] /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `initialize': stderr
[default] : : stderr
[default] Read-only file system - /tmp/vagrant-chef-1/chef-stacktrace.out: stderr
[default] (: stderr
[default] Errno::EROFS: stderr
[default] )
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `open'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `store'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:133:in `debug_stacktrace'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:210:in `run_application'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:183:in `loop'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:183:in `run_application'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:66:in `run'
: stderr
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-solo:25
from /opt/ruby/bin/chef-solo:19:in `load'
from /opt/ruby/bin/chef-solo:19
: stderr
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json
The output of the command prior to failing is outputted below:
[no output]
通常、私は VM を破棄し、新しい試行ごとに vagrant up を実行していますが、vagrant reload と vagrant provision を数回試しましたが、同じ結果が得られました。
また、これが正常かどうかはわかりませんが、私の Mac はプロビジョニング中にほぼ完全にロックされます。私は通常、2 つまたは 3 つの vmware VM を同時に実行できますが、あまり苦労しているように感じることはありません。