我正在尝试通过 ansible-galaxy 安装 ansible 集合。然而,程序在这一步中卡住了与 Galaxy_server 的初始连接:https://galaxy.ansible.com我不知道问题出在哪里。我认为与服务器的连接可能存在问题,因此手动下载并以 tarball 形式提供该集合。然而,这并没有改变任何事情。有什么想法我可能会错过吗?
ansible-galaxy collection install ~/Download/ansible.posix-1.3.0.tar.gz -vvvv
ansible-galaxy 2.5.1
config file = /home/philipp/.ansible.cfg
configured module search path = [u'/home/philipp/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible-galaxy
python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
Using /home/philipp/.ansible.cfg as config file
Opened /home/philipp/.ansible_galaxy
Processing role collection
Opened /home/philipp/.ansible_galaxy
Initial connection to galaxy_server: https://galaxy.ansible.com
更新
显然,它没有被卡住,但速度非常慢。当输入问题时,程序继续进行。
ansible-galaxy 2.5.1
config file = /home/philipp/.ansible.cfg
configured module search path = [u'/home/philipp/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible-galaxy
python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
Using /home/philipp/.ansible.cfg as config file
Opened /home/philipp/.ansible_galaxy
Processing role collection
Opened /home/philipp/.ansible_galaxy
Initial connection to galaxy_server: https://galaxy.ansible.com
Base API: https://galaxy.ansible.com/api/v1
- downloading role 'collection', owned by
https://galaxy.ansible.com/api/v1/roles/?owner__username=&name=collection
[WARNING]: - collection was NOT installed successfully: Content has no field named 'owner'
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
答案1
解决方案:将 Ansible 更新为2.9.26
搜索警告后,我发现我的 ansible 版本太旧了。将 ansible 更新到版本后,2.9.26
安装ansible-galaxy collection install ansible.posix
似乎可以正常工作。