简体   繁体   中英

ansible-galaxy install fails when specifying a version in requirements

Not sure if this is a bug in ansible-galaxy , but I'm trying to install roles from a requirements.yml file ( related ansible documentation .) One of those roles is being pulled from git, with a specific version like so:

requirements.yml :

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

When I run ansible-galaxy install I get the following output:

± 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.

If I change the version to master it works. I've tried this with other roles in git repos with the same result.

Oddly, ansible-galaxy itself doesn't seem to have a --version output however ansible --version reports v1.8.3.

It's a known issue . In the meantime, as a workaround, modify the version in requirements.yml as shown below:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM