Roles in playbook-local collections in not working in Molecule 3.0.6 with ansible 2.10
See original GitHub issueIssue Type
- Bug report
Molecule and Ansible details
$ molecule --version
molecule 3.0.6
ansible==2.10.0a3 python==3.7
Molecule installation method (one of):
- pip
Ansible installation method (one of):
- pip
Detail any linters or test runners used:
Entire configuration is here: https://github.com/geerlingguy/ansible-content-testing
- Git clone that repo
- Install Ansible 2.10 distribution:
pip3 install --pre ansible>=2.10
- Run
molecule test
(uses Docker to bring up akind
instance)
Desired Behavior
Roles that are in collections local to a playbook should be picked up and usable by Ansible.
See the example.one
and example.two
collections in the repository: https://github.com/geerlingguy/ansible-content-testing
Actual Behaviour
TASK [Include a 'test' role from 'example.one' collection.] ********************
ERROR! the role 'example.one.test' was not found in community.kubernetes:ansible.legacy:/Users/jgeerling/Development/GitHub/ansible-content-testing/molecule/default/../../roles:/Users/jgeerling/.cache/molecule/ansible-content-testing/default/roles:/Users/jgeerling/Development/GitHub:/Users/jgeerling/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/jgeerling/Development/GitHub/ansible-content-testing/molecule/default/../..
The error appears to be in '/Users/jgeerling/Development/GitHub/ansible-content-testing/tasks/same-name-roles.yml': line 4, column 11, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
include_role:
name: example.one.test
^ here
This started happening once 3.0.6 was released, and I believe the change in https://github.com/ansible-community/molecule/pull/2745 was what triggered the problem.
The molecule configuration is in the molecule subdirectory inside the ansible-content-testing repo.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Using Ansible collections
Collections are a distribution format for Ansible content that can include playbooks, roles, modules, and plugins. You can install and use collections through...
Read more >How to add integration tests to an Ansible collection with ...
Currently, Molecule doesn't know much about collections, so you should not use the molecule init command to create a collection (that only ...
Read more >Episode 13 - Ansible Collections and a Test Plugin - YouTube
Jeff Geerling (geerlingguy) introduces Ansible Content Collections ; their history, what they can do, and how they can be used.
Read more >About Ansible Molecule — Molecule Documentation
Molecule project is designed to aid in the development and testing of Ansible roles. Molecule provides support for testing with multiple instances, ...
Read more >How to set up and use Python virtual environments for Ansible
Python's venv module gives you freedom to test new Ansible features ... You can also install Ansible roles and collections into a Python ......
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
Weird, with Ansible 2.9.10 installed I’m now getting:
See here for fix: https://github.com/ansible-collections/community.kubernetes/issues/135#issuecomment-661189940
I think this was fixed with the latest versions as I was able to reproduce it.