Specify Collection for Galaxy dependency
See original GitHub issueIssue Type
- Feature request
Molecule and Ansible details
ansible --version && molecule --version
ansible 2.9.1
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/artis3n/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/artis3n/.local/share/virtualenvs/dev-setup-cQlga8yo/lib/python3.7/site-packages/ansible
executable location = /home/artis3n/.local/share/virtualenvs/dev-setup-cQlga8yo/bin/ansible
python version = 3.7.5 (default, Nov 24 2019, 17:46:35) [GCC 9.2.1 20191008]
molecule, version 2.22
Molecule installation method (one of):
- source
- pip (pipenv)
Ansible installation method (one of):
- source
- pip (pipenv)
- OS package
Desired Behavior
dependency:
name: galaxy
options:
role-file: requirements.yml
collection-file: requirements.yml
With a requirements.yml
format following https://docs.ansible.com/ansible/devel/user_guide/collections_using.html#install-multiple-collections-with-a-requirements-file:
---
roles:
- src: gantsign.visual-studio-code
- src: artis3n.bitwarden_app
collections:
- name: artis3n.github
Molecule’s galaxy
dependency doesn’t appear to support a collection-file
similar to the role-file
to install Galaxy Collections. I posed a question on Stack Overflow but based on the documentation I’m reasonably sure the functionality doesn’t exist yet, so posting a feature request.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Galaxy User Guide - Ansible Documentation
To find collections on Galaxy: Click the Search icon in the left-hand navigation. Set the filter to collection. Set other ...
Read more >Specify Collection dependency for Molecule - ansible
How can I inform Molecule that it needs to download a Collection for a ansible-galaxy dependency? My requirements.yml file looks like this: --- ......
Read more >Using collections — Ansible Documentation
To search other paths for collections, use the -p option. Specify multiple search paths by separating them with a : . The list...
Read more >Collections from Playbook - :: Ansible Labs for AnsibleFest
You can find a list of all modules and collections written by the Ansible Core Team on Ansible Galaxy. Head over there and...
Read more >Dependency confusion in the Ansible Galaxy CLI | die-welt.net
However, I think this is not even the main problem here. The documentation says: Once a collection is found, any of its requirements...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
PR #2609 is up. For me, at least, it supports what I need. It does not default to using the same file as the
role-file
argument. Prior to collections, a requirements.yml could just be a list of roles, e.g.:To install collections with ansible-galaxy you MUST indicate a collections key with appropriate names in a list. Optionally roles can be kept in the same file
If I pointed collections at the same
requirements.yml
that is used for “ansible-galaxy install” calls currently, it would detect the file and could cause existing scenarios to break unnecessarily if they do not match the newer dictionary syntax.So the PR looks, by default, for
collections.yml
and can be configured with therequirements-file
key in yourmolecule.yml
.As an update, I have code working in my local space for this. I’m working on updating unit and functional tests to accommodate the code changes I’ve made. Expect a PR within a day or two.