Ant*_*ane 2 ansible ansible-galaxy
我正在尝试安装 Ansible Galaxy 系列,但我需要强制使用较旧的版本。根据文档,我尝试通过以下方式执行安装:
$ ansible-galaxy collection install 'weareinteractive.ufw:>=1.10.0,<2.0.0'
Process install dependency map
ERROR! Failed to find collection weareinteractive.ufw:>=1.10.0,<2.0.0
$ ansible-galaxy collection install 'weareinteractive.ufw:<2.0.0'
Process install dependency map
ERROR! Failed to find collection weareinteractive.ufw:<2.0.0
Run Code Online (Sandbox Code Playgroud)
当我尝试这样做时,我在全球范围内都会遇到同样的错误requirements.yml:
---
- name: weareinteractive.ufw
version: '>=1.8.0,<2.0.0'
Run Code Online (Sandbox Code Playgroud)
运行命令
$ ansible-galaxy install -r requirements.yml
- downloading role 'ufw', owned by weareinteractive
[WARNING]: - weareinteractive.ufw was NOT installed successfully: - the specified version (>=1.8.0,<2.0.0) of weareinteractive.ufw was not found in the list of available versions ([{'id': 141713, 'url': '', 'related': {}, 'summary_fields': {}, 'created':
'2020-11-25T18:52:30.171540Z', 'modified': '2020-11-25T18:52:30.171568Z', 'name': '2.0.1', 'version': '2.0.1', 'commit_date': '2020-11-25T10:51:53-05:00', 'commit_sha': '30b1fdc8f5440e865d3fbeb83894941bf70739c7', 'download_url':
'https://github.com/weareinteractive/ansible-ufw/archive/2.0.1.tar.gz', 'active': None}, {'id': 76043, 'url': '', 'related': {}, 'summary_fields': {}, 'created': '2018-10-04T14:07:47.602784Z', 'modified': '2018-10-04T14:07:47.602810Z', 'name': '1.8.0', 'version':
'1.8.0', 'commit_date': '2018-10-04T10:05:07-04:00', 'commit_sha': 'ae776a7dc255ba5dc679cedee32129ba22c0e797', 'download_url': 'https://github.com/weareinteractive/ansible-ufw/archive/1.8.0.tar.gz', 'active': None}, .....]).
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
Run Code Online (Sandbox Code Playgroud)
我缺少什么?
编辑:我正在使用 ansible / ansible-galaxy 2.9.16,但我期望有一个仍然适用于 ansible 2.10 的解决方案
如您尝试安装的角色的存储库首页所述:
Ansible wereinteractive.ufw 角色
来源:https ://github.com/weareinteractive/ansible-ufw#ansible-weareinteractiveufw-role
它是一个角色而不是一个集合。
尽管这两种语法可能看起来很相似,但它们实际上并不完全具有相同的语法。
对于角色,首先,您不要通过以下方式安装它们
ansible-galaxy collection install some-collection
Run Code Online (Sandbox Code Playgroud)
显然,但是通过:
ansible-galaxy install some-role
Run Code Online (Sandbox Code Playgroud)
注意:他们的 GitHub 页面和 Ansible Galaxy 页面都证实了这一点,建议您通过以下方式安装该角色
ansible-galaxy install weareinteractive.ufw
Run Code Online (Sandbox Code Playgroud)
来源: https: //galaxy.ansible.com/weareinteractive/ufw 和https://github.com/weareinteractive/ansible-ufw
然后,版本固定也不同。对于角色,您必须指定版本,而不是版本范围:
当 Galaxy 服务器导入角色时,它会导入与语义版本格式匹配的任何 git 标签作为版本。反过来,您可以通过指定导入的标签之一来下载角色的特定版本。
所以你必须根据他们的仓库的 git 标签,例如
ansible-galaxy install weareinteractive.ufw,v1.10.0
Run Code Online (Sandbox Code Playgroud)
而且requirement.yml也有一点不同,你还必须给出一个特定的版本。
- name: weareinteractive.ufw
version: v1.10.0
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6547 次 |
| 最近记录: |