在需求中指定版本时,ansible-galaxy安装失败

时间:2015-03-04 19:47:02

标签: ansible ansible-galaxy

不确定这是否是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。

1 个答案:

答案 0 :(得分:9)

它是known issue。在此期间,作为解决方法,修改requirements.yml中的版本,如下所示:

---
- src:  https://github.com/thom-nic/ansible-shell
  name: thom-nic.shell
  version: remotes/origin/develop