【问题标题】:Problems with Ansible and GitHubAnsible 和 GitHub 的问题
【发布时间】:2016-10-29 05:01:27
【问题描述】:

我已经通过互联网挖掘并尝试了一切。我试过了:

- name: ensure github.com in known host
  shell: ssh-keyscan -H github.com >> /home/{{ deploy_user }}/.ssh/known_hosts

和:

[ssh_connection]
ssh_args = -o ForwardAgent=yes

我还尝试在 git 模块上使用 key_file 属性,我似乎剩下的唯一选择是从服务器复制公钥并将其添加到 github,但这会使扩展变得困难和缓慢.无论我做什么,我都会得到:

权限被拒绝(公钥)。\r\n致命:无法从远程存储库读取。\n\n请确保您具有正确的访问权限\n并且存储库存在。

【问题讨论】:

  • 当我将我的网址从 git@github.com:/.git 更改为 git://github.com//.git 我得到 @ 987654325@
  • 我什至试过这里提到的方法claudiokuenzler.com/blog/604/…
  • 您将服务器身份验证与用户身份验证混淆了。从您在 cmets 中发布的博客链接(顺便说一句,您应该在问题中指定这一点,而不是 cmets),看起来您不想使用公钥身份验证,但错误消息清楚地表明您正在使用它。您的故障排除误入歧途,并且您发布了与您的问题完全无关的信息。用你的完整剧本和你得到的结果编辑问题。

标签: git github ssh ansible


【解决方案1】:

我似乎剩下的唯一选择是从服务器复制公钥并将其添加到 github

Ansible 与否,如果您使用公共 ssh 密钥,如果您希望对 github.com 的任何 ssh 调用成功(不回退到用户名/密码身份验证方案),则所述密钥必须为 be declared to a GitHub account setting

而且你没有直接给“github.com”authorized_keys添加公钥,但是需要使用GitHub create key API注册一个新的。
见“Ansible Module - Github Keys

【讨论】:

  • 我尝试使用 github_key 模块,但它说找不到 github_key 模块。 docs.ansible.com/ansible/github_key_module.html
  • 在配置的模块路径中找不到模块 github_key。此外,缺少核心模块。如果这是结帐,请运行 'git submodule update --init --recursive' 来纠正此问题。我使用自制软件安装它
  • @brianthecoder 那么'git submodule update --init --recursive 解决了这个问题吗?
  • 不行,我去homebrew安装的目录下得到fatal: Not a git repository (or any of the parent directories): .git现在只能pip安装吗? Homebrew 曾经工作过
猜你喜欢
  • 1970-01-01
  • 2019-04-08
  • 2012-01-17
  • 1970-01-01
  • 1970-01-01
  • 2022-10-15
  • 2018-05-15
  • 2020-05-30
  • 1970-01-01
相关资源
最近更新 更多