不确定这是否是ansible-galaxy
中的错误,但我正在尝试从requirements.yml文件(related ansible documentation)安装角色。)其中一个角色是从git中提取的,特定的version
如此:
requirements.yml :
---
- src: https://github.com/thom-nic/ansible-shell
name: thom-nic.shell
version: develop
当我运行ansible-galaxy install
时,我得到以下输出:
± ansible-galaxy install -r requirements.yml --force
- executing: git clone https://github.com/thom-nic/ansible-shell thom-nic.shell
- executing: git archive --prefix=thom-nic.shell/ --output=/var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpF4GAqD.tar develop
- command git archive --prefix=thom-nic.shell/ --output=/var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpF4GAqD.tar develop failed
in directory /var/folders/cw/9vh4w77n4vb_bchhsxnglrcm0000gn/T/tmpIyYaJz
- thom-nic.shell was NOT installed successfully.
如果我将version
更改为master
则可行。我已经在git repos中尝试了其他角色,结果相同。
奇怪的是,ansible-galaxy
本身似乎没有--version
输出,但ansible --version
报告v1.8.3。
答案 0 :(得分:9)
它是known issue。在此期间,作为解决方法,修改requirements.yml中的版本,如下所示:
---
- src: https://github.com/thom-nic/ansible-shell
name: thom-nic.shell
version: remotes/origin/develop