![](/img/trans.png)
[英]`git clone` fails for role in private git repo when running `ansible-galaxy install -r requirements.yml`
[英]ansible-galaxy install fails when specifying a version in requirements
不确定这是否是ansible-galaxy
的错误,但我正在尝试从requirements.yml文件( 相关的ansible文档 )安装角色。其中一个角色是从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 ansible --version
报告v1.8.3。
这是一个众所周知的问题 。 在此期间,作为解决方法,修改requirements.yml中的版本,如下所示:
---
- src: https://github.com/thom-nic/ansible-shell
name: thom-nic.shell
version: remotes/origin/develop
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.