首页 > 解决方案 > Ansible Galaxy 中 GitHub 组织命名空间用于集合的目的是什么

问题描述

我在 Ansible Galaxy 中注意到,当我导航到https://galaxy.ansible.com/my-content/namespaces时,我看到两个命名空间:

  1. 一个对应于我的 GitHub 用户名,比如说user.
  2. 一个对应于我创建的一个 GitHub 组织,比如说mycompany.

我可以mycollection在命名空间下构建一个集合usermycompany但发布只能在user. 换句话说,我只能发布user.mycollection. 如果我尝试发布mycompany.mycollection,则会出现错误消息

user:~/git/ … /ansible-collection-apps] master* ± ansible-galaxy collection publish *.tar.gz --token=2daf0378704a85722dc8a358359f8967b0681917
Publishing collection artifact '/home/user/git/github/mycompany/mycollection/mycollection-1.0.0.tar.gz' to default https://galaxy.ansible.com/api/
ERROR! Error when publishing collection to default (https://galaxy.ansible.com/api/) (HTTP Code: 400, Message: Namespace "mycompany" does not exist. Code: invalid)  

显然,我正在使用从 GitHub 组织创建的 Galaxy 命名空间,例如mycompany以一种意想不到的方式。

这些命名空间打算如何使用?它们可以使用吗?我尝试了例如命名空间user.mycompany,但这不是一个有效的集合命名空间。

标签: ansibleansible-galaxy

解决方案


您必须请求访问其他命名空间。查看Galaxy 命名空间 — Ansible 文档


推荐阅读