Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ansible Galaxy集合依赖项SSH错误与专用GitHub repo_Github_Ssh_Ansible_Ansible Galaxy_Ansible Collections - Fatal编程技术网

Ansible Galaxy集合依赖项SSH错误与专用GitHub repo

Ansible Galaxy集合依赖项SSH错误与专用GitHub repo,github,ssh,ansible,ansible-galaxy,ansible-collections,Github,Ssh,Ansible,Ansible Galaxy,Ansible Collections,作为Ansible集合的新手,我希望在尝试使用私有GitHub存储库将一些旧Ansible角色重构为集合时,我错过了一些明显的东西 我有两个链接帐户的GitHub设置。我将呼叫主要的个人帐户GITHUB\u AC\u P。个人帐户链接到一个子组织帐户,我称之为GITHUB\u AC\u O。我可以在GitHub web UI中切换这些帐户,并使用~/.ssh/config中的以下单个条目访问git客户端的两个帐户: Host GITHUB_AC_P.github.com HostName g

作为Ansible集合的新手,我希望在尝试使用私有GitHub存储库将一些旧Ansible角色重构为集合时,我错过了一些明显的东西

我有两个链接帐户的GitHub设置。我将呼叫主要的个人帐户
GITHUB\u AC\u P
。个人帐户链接到一个子组织帐户,我称之为
GITHUB\u AC\u O
。我可以在GitHub web UI中切换这些帐户,并使用
~/.ssh/config
中的以下单个条目访问git客户端的两个帐户:

Host GITHUB_AC_P.github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_github_REDACTED_GITHUB_A
我首先在帐户
GitHub\u AC\u O
中将Ansible Galaxy集合文件添加到名为
Ansible.common
的新GitHub存储库中。我计划在其他Ansible Galaxy系列中重复使用此系列。它目前只有一个角色和以下
galaxy.yml
文件:

namespace: REDACTED_NS
name: common
version: 0.0.1
description: "Common Ansible collection"
readme: README.md
authors:
  - REDACTED_AUTHOR
以下命令报告“已成功安装”,我在
~/.ansible/collections/ansible\u collections/REDACTED\n s/common
中看到集合:

ansible-galaxy collection install git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git,main
然后,我在一个名为
Ansible.harden\u host
的新GitHub存储库中创建了第二个Ansible Galaxy集合。这也在帐户
GITHUB\u AC\u O
中。该文件目前没有任何角色,并使用以下
galaxy.yml
文件引用上述通用集合(两个galaxy.yml文件中的修订值相同):

但当我运行以下程序时:

ansible-galaxy collection install --verbose git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.harden_host.git,main
ansible-galaxy collection install --ignore-certs git@GUTHUB_AC_P.github.com:GITHUB_AC_O/ansible.harden_host.git,main
它失败,并显示以下消息:

Starting galaxy collection install process
Process install dependency map
ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)>
它将失败,并显示以下不同消息:

ERROR! Failed to find collection REDACTED_NS.common:git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git
我将此错误中的URI(冒号右侧)粘贴到
ansible galaxy collection install
命令中,以验证URI中没有输入错误。这很有效

编辑的字符串不等于GITHUB_AC_p或GITHUB_AC_O的值


如果有人能解释一下这里出了什么问题,以及如何解决这个问题,我们将不胜感激。

已解决;答案似乎隐藏在Ansible文档中的plain site中,该文档表示对基于git的依赖项使用以下形式:

dependencies: {'git@github.com:organization/repo_name.git': 'devel'}
我使用的表单是针对Galaxy服务器的,因此它访问了
Galaxy.ansible.com
(除非我用
--server localhost
覆盖默认值)

因此,以下表格有效(git回购,然后是git参考):

dependencies: {'git@github.com:organization/repo_name.git': 'devel'}
namespace: REDACTED_NS
name: harden_host
version: 0.0.1
description: "Ansible collection to harden hosts"
readme: README.md
authors:
  - REDACTED_AUTHOR
dependencies: {
  'git@GITHUB_AC_P.github.com:GITHUB_AC_O/ansible.common.git': 'main'
}