我是一个 Vagrant 初学者,正在使用 chef-solo 设置一个相当简单的 CentOS LAMP 盒子,但无法使 Vagrant 和 Chef 的 knife 命令协同工作。
以下是问题的简要说明:
我使用vagrantbox.es上的基于CentOS 6.3 w/ Chef基础盒子创建了一个基本的Vagrantfile。你可以在this gist中看到基本信息。 我通过
然而,我可以运行When I run
以下是问题的简要说明:
我使用vagrantbox.es上的基于CentOS 6.3 w/ Chef基础盒子创建了一个基本的Vagrantfile。你可以在this gist中看到基本信息。 我通过
knife cookbook site install nameofcookbook
下载了所有的cookbook,并使用配置将它们放在./chef/cookbooks
中。
我成功地运行了vagrant up
,你可以在this gist中看到基本信息。
我测试了apache、php等,一切正常。
现在来关键的部分:在虚拟机运行时,我使用knife添加了另一个软件包(在这种情况下是i3)。
从这里开始,Vagrant无法在虚拟机中执行各种任务:
当我运行vagrant provision
时,会出现以下错误:
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
当我运行vagrant halt
时,出现一个错误,提示ssh命令以非零错误代码退出。然而,我可以运行
vagrant ssh
,并确认(a)在虚拟机中确实存在chef-solo,(b)我可以通过命令行关闭虚拟机。
vagrant up
I get an error like this:
The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! mkdir -p /vagrant</li>
I'm stumped. I've had this happen on two boxes already, and I know that Knife and Vagrant should be able to play well together.
What am I doing wrong?
Any help much appreciated, I've very excited about digging into Vagrant!
config.omnibus.chef_version = :latest
,并在vagrant plugin install vagrant-omnibus
之前安装了vagrant插件。 - holms