指定 Molecule 的 Collection 依赖性

Specify Collection dependency for Molecule

Molecule 被告知通过

从 Ansible Galaxy 下载角色依赖项
dependency:
  name: galaxy
  options:
    role-file: requirements.yml

但是,似乎没有任何文档说明如何通知 Molecule 下载 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为此。

如果这是 Molecule 的已解决问题,请在此处询问,否则我想这将是 Molecule github 存储库上的功能请求。我如何通知 Molecule 它需要为 ansible-galaxy 依赖项下载一个集合?

我的 requirements.yml 文件如下所示:

---

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

collections:
 - name: artis3n.github

Ansible 在 https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#install-multiple-collections-with-a-requirements-file 支持此格式。

documentation now covers collections as well since #2609。但是,如果您查看此拉取请求,您会发现它不应该通过,因为测试失败了。 8 天前我无法在我的主机上获得有效的解决方案,这是有道理的;我注意到测试通过后的最后一次合并是 8 天前。

我认为这个最新的合并还没有发布,但我相信有 workaround

我针对 Molecule 提出的问题已经完成,因此从版本 3.0.3 开始,此功能现在存在于 Molecule 中。