gpt4 book ai didi

git - Vagrant 测试 Chef Recipe - 但如何处理私有(private) git

转载 作者:太空狗 更新时间:2023-10-29 13:56:56 24 4
gpt4 key购买 nike

我使用 vagrant 来测试我的 Chef Recipe 。问题是我已经克隆了我的私有(private)仓库并且机器没有被自动处理。我如何自动对 boostrap Chef 进行 git 身份验证?我正在和 Chef 一起使用 vagrant ubuntu 11.10。

谢谢

最佳答案

use ssh keys with passphrase on a vagrant+chef setup会有类似的答案,可能会有帮助。

不知道 chef-solo 或 chef-client + chef-server 的更多细节。它归结为 ssh key 。

确保你正在使用类似git@github.com:user/repo.git

然后你会想要确保你的虚拟机和底层主机是ssh代理转发。

确保你的 ~/.ssh/config 有合适的行。一个一般的例子是。

host *
ForwardAgent yes

请记住,第一个匹配项在 ~/.ssh/config 中获胜,而不是最具体的匹配项

然后您可能必须使用 ssh-add 添加任何身份,并确保 ssh-agent 也存在。

最后,在 Vagrantfile 中,config.ssh.forward_agent = true

关于git - Vagrant 测试 Chef Recipe - 但如何处理私有(private) git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10699333/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com