【问题标题】:Vagrant to test chef recipies - but how to deal with private gitVagrant 测试厨师食谱 - 但如何处理私人 git
【发布时间】:2012-08-17 01:47:32
【问题描述】:
我使用 vagrant 来测试我的厨师食谱。问题是我已经克隆了我的私人存储库并且机器没有经过验证。我如何自动 git 身份验证来引导厨师?我正在使用 vagrant ubuntu 11.10 with chef。
谢谢
【问题讨论】:
标签:
git
github
chef-infra
vagrant
【解决方案1】:
use ssh keys with passphrase on a vagrant+chef setup
会有类似的答案可能会有所帮助。
不知道chef-solo 或chef-client + chef-server 的更多细节。归结为 ssh 密钥。
确保您正在使用类似的东西进行身份验证
git@github.com:user/repo.git
然后你需要确保你的虚拟机和底层主机是 ssh 代理转发的。
确保你的 ~/.ssh/config 有适当的行。一个普遍的例子是。
host *
ForwardAgent yes
记住第一个匹配在 ~/.ssh/config 中获胜,而不是最具体的
然后您可能需要使用ssh-add 添加任何身份,并确保ssh-agent 也存在。
最后,在 Vagrantfile 中,
config.ssh.forward_agent = true