首页 > 解决方案 > 无法将集合从 GitLab 安装到 RHEL AutomationHub

问题描述

无法在我们的命名空间中从 GitLab 安装集合到 RHEL 自动化中心。实际上,我想提取许多存储在 GitLab 存储库中的 Ansible Playbook。我在脚本下面提到过。如果我在任何地方错了,请纠正我。

cat requirement.yaml

collections:
  - name: https://gitlab.com/organization/CiscoAutomation.git
    token: <tokenName>
    type: git
    version: 1.0

cat ansible.cfg

[defaults]
COLECTIONS_PATH = ./collections


$ ansible-galaxy install -r requirements.yml
Executed without any error but nothing has installed.
then I tried this below command also after SSH
ansible-galaxy collection install git@github.com:organization/ciscoautomation.git

[root@autohub01 CADir]# ansible-galaxy collection install git@gitlab.com/ciscoautomation.git -vvv 
ansible-galaxy 2.9.15
  config file = /root/CADir/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible-galaxy
  python version = 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] Using /root/test/ansible.cfg as config file Found installed collection davidban77.gns3:1.5.0 at '/root/.ansible/collections/ansible_collections/davidban77/gns3'
Found installed collection bonddim.linux:1.2.1 at '/root/.ansible/collections/ansible_collections/bonddim/linux'
Found installed collection community.docker:1.6.1 at '/root/.ansible/collections/ansible_collections/community/docker'
Found installed collection community.general:3.1.0 at '/root/.ansible/collections/ansible_collections/community/general'

当我尝试在 AutomationHub GUI 中导入我们命名空间中的集合时,它不接受 yaml 或 txt 格式。

标签: gitautomationansiblegitlab

解决方案


推荐阅读