![](/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.