4

Molecule is informed to download role dependencies from Ansible Galaxy via

dependency:
  name: galaxy
  options:
    role-file: requirements.yml

However, there doesn't appear to be any documentation on how Molecule can be informed to download Collections. https://molecule.readthedocs.io/en/stable/configuration.html#ansible-galaxy does not list a collections option and I don't see an open feature request on https://github.com/ansible/molecule for this.

Asking here in case this is a solved issue for Molecule, otherwise I suppose this would be a feature request on the Molecule github repo. How can I inform Molecule that it needs to download a Collection for a ansible-galaxy dependency?

My requirements.yml file looks like this:

---

roles:
- src: gantsign.visual-studio-code
- src: artis3n.bitwarden_app

collections:
 - name: artis3n.github

This format is supported by Ansible at https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#install-multiple-collections-with-a-requirements-file.

artis3n
  • 810
  • 2
  • 12
  • 23
  • 1
    I was about to tell your there is an [open ticket on the subject on github](https://github.com/ansible/molecule/issues/2466)... until I found out you are the author ;) Good job by the way. That might still benefit other readers which can thumb-up the issue. – Zeitounator Dec 11 '19 at 11:11
  • Thanks for reminding me I needed to update my stack exchange username! – artis3n Dec 11 '19 at 21:21

2 Answers2

1

The issue I filed against Molecule has been completed, so this functionality is now present in Molecule as of version 3.0.3.

artis3n
  • 810
  • 2
  • 12
  • 23
0

The documentation now covers collections as well since #2609. However, if you look at this pull request you can see it shouldn't have passed because the tests fail. It makes sense now that I was unable to get a working solution on my host more than 8 days ago; I notice the last merge after tests passed was 8 days ago.

I don't think this latest merge has been released yet, but I believe there is a workaround.

Sebastiaan
  • 106
  • 7