ansiblemolecule

Specify Collection dependency for Molecule


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.


Solution

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