# Collection testing with molecule, roles are not reconized

**URL:** <https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720>\
**Category:** Get Help\
**Tags:** collections, galaxy-ng\
**Created:** [December 4, 2023, 7:21am UTC](https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720 "2023-12-04T07:21:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Matthias](https://forum.ansible.com/u/Matthias)\
**Post date:** [December 4, 2023, 7:21am UTC](https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720/1 "2023-12-04T07:21:11Z")

</div>

Hi guys,

We are currently creating our own collections which we will provide internally via the private hub functionality of the AAP.

For this I created a template for the collections. Main use case is to provide roles for our automation.  
In the CI/CD pipline we use ansible-test for the collection itself and additionally we want to use molecule to test the single roles.

The git repo of a collection looks like this:

```auto
general
├── ansible.cfg
├── ansible_collections
│ └── <namespace>
│ └── general
│ ├── docs
│ ├── galaxy.yml
│ ├── meta
│ │ └── runtime.yml
│ ├── plugins
│ │ └── README.md
│ ├── README.md
│ ├── requirements.txt
│ └── roles
│ └── create_ci
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── README.md
│ ├── requirements.yml
│ ├── tasks
│ │ └── main.yml
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── vars
│ └── main.yml
├── molecule
│ └── default
│ ├── converge.yml
│ ├── create.yml
│ ├── destroy.yml
│ └── molecule.yml
└── README.md

```

The folder structure under ansible\_collection / namespace / collection is used to create a clean collection with ansible-galaxy collection build in the release pipline and upload it to the hub

If I create the collection, upload it to the hub and install it to a system I can use the role without any issues. In the molecule output I can see the path, which is set in the molecule.yml below

If I try to test the role with molecule I get always the error, the role is not found.

```auto
provisioner:
  name: ansible
  env:
    ANSIBLE_ROLES_PATH: "../../ansible_collections/<namespace>/general/roles"

```

Any ideas where the issue can be located?  
molecule 6.0.2 using python 3.9  
ansible:2.15.5  
default:6.0.2 from molecule

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [December 15, 2023, 4:48pm UTC](https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720/2 "2023-12-15T16:48:25Z")

</div>

Hi,

Have a look here: [Sharing - Ansible Molecule](https://ansible.readthedocs.io/projects/molecule/guides/sharing/#sharing-across-scenarios) 🙂

---

<div class="post-metadata">

**Author:** ![Matthias](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Matthias](https://forum.ansible.com/u/Matthias)\
**Post date:** [February 16, 2024, 9:10am UTC](https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720/3 "2024-02-16T09:10:19Z")

</div>

Hi Pierre,  
Unfortunately, this didn’t help. Molecule lists the path to the roles folder, but does not recognize the roles

---

<div class="post-metadata">

**Author:** ![ericsysmin](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ericsysmin/32/1997_2.png) [@ericsysmin](https://forum.ansible.com/u/ericsysmin)\
**Post date:** [April 5, 2024, 3:34am UTC](https://forum.ansible.com/t/collection-testing-with-molecule-roles-are-not-reconized/2720/4 "2024-04-05T03:34:09Z")

</div>

Did you ever get this figured out? I may be able to help. You may need to use fqcn on your converge.yml
