我和Vagrant n00b在让Vagrant和Chef的knife
命令一起玩的过程中遇到问题,因为我正在设置一个非常简单的CentOS LAMP盒子厨师独奏。
以下是该问题的快速概述:
knife cookbook site install nameofcookbook
中的./chef/cookbooks
配置通过vagrant up
下载了所有食谱。vagrant provision
您可以在this gist中查看基础知识。当我运行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
当我运行vagrant ssh
时,出现错误,ssh命令以非零错误代码退出。
vagrant up
,并确认(a)厨师独奏确实存在于框中,(b)我可以通过框中的命令行关闭。The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mkdir -p /vagrant</li>
时,我收到如下错误:
{{1}}
我做错了什么?
任何帮助都非常感激,我对挖掘Vagrant感到非常兴奋!
答案 0 :(得分:17)
chef.add_recipe "sudo"
在第一次运行后识别你的sudo文件。
为您的流浪者用户添加适当的json到您的vagrant文件。
类似的东西:
config.vm.provision :chef_solo do |chef|
# add your recipes
# chef.add_recipe "foo"
# chef.add_role "bar"
chef.json = {
"authorization" => {
"sudo" => {
"users" => [ "vagrant" ],
"passwordless" => true,
}
}
}
end