2.4. 配置社区远程存储库并同步 Ansible Galaxy 集合。
您可以编辑 community 远程存储库,将所选集合从 Ansible Galaxy 同步到私有自动化中心。默认情况下,您的私有自动化中心 community 存储库定向到 galaxy.ansible.com/api/
。
先决条件
- 您有修改 Ansible 存储库内容的权限。如需有关 权限的更多信息,请参阅在 Automation Hub 中管理用户访问权限。
-
您有一个
requirements.yml
文件,用于标识要从 Ansible Galaxy 同步的集合,如下例所示:
Requirements.yml 示例
collections: # Install a collection from {Galaxy}. - name: community.aws version: 5.2.0 source: https://galaxy.ansible.com
流程
- 登录您的 Ansible Automation hub。
- 进入 。
- 点 Remotes 选项卡。
-
在 Community 远程中,点 图标
并点 。
-
在相应的界面中,点
requirements.yml
文件。 并在本地机器上找到 点击
。界面关闭并返回到 Repo Management 页面。现在,您可以将
requirements.yml
文件中标识的集合从 Ansible Galaxy 同步到私有自动化中心。- 点 以同步来自 Ansible Galaxy 和 Ansible Automation Hub 的集合。
Sync status 通知会更新,以告知您与 Ansible Automation Hub 同步 Ansible Galaxy 集合的完成或失败。
验证
- 从集合内容下拉列表中选择 Community 以确认同步成功。