# Using molecule with multi-role repositories

**URL:** <https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211>\
**Category:** Get Help\
**Tags:** documentation, molecule\
**Created:** [April 30, 2024, 7:23am UTC](https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211 "2024-04-30T07:23:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![upon8877](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/upon8877/32/3031_2.png) [@upon8877](https://forum.ansible.com/u/upon8877)\
**Post date:** [April 30, 2024, 7:23am UTC](https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211/1 "2024-04-30T07:23:06Z")

</div>

Hi,

I have a repository with multiple roles, and need some guidance on how to run molecule. Are there any guides/examples on configuring molecule to run on roles based on a glob or wildcard path?

I know there was a [discussion](https://github.com/ansible/molecule/issues/1744) on this a few years ago, but I have not seen any recent development or examples.

I appreciate the help!

---

<div class="post-metadata">

**Author:** ![Thulium-Drake](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thulium-drake/32/833_2.png) [@Thulium-Drake](https://forum.ansible.com/u/Thulium-Drake)\
**Post date:** [April 30, 2024, 8:54am UTC](https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211/2 "2024-04-30T08:54:28Z")

</div>

You might want to check @evgeni 's blog on this, he just posted it last week 😉

> **[Running Ansible Molecule tests in parallel](https://www.die-welt.net/2024/04/running-ansible-molecule-tests-in-parallel/)**
>
> Or "How I've halved the execution time of our tests by removing ten lines".
> Catchy, huh? Also not exactly true, but quite close. Enjoy!
> Molecule?!
> "Molecule project is designed to aid in the developme

---

<div class="post-metadata">

**Author:** ![upon8877](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/upon8877/32/3031_2.png) [@upon8877](https://forum.ansible.com/u/upon8877)\
**Post date:** [April 30, 2024, 6:16pm UTC](https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211/3 "2024-04-30T18:16:19Z")

</div>

Oh nice, I’ll check this out! Thank you!

---

<div class="post-metadata">

**Author:** ![ryguy](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ryguy/32/3305_2.png) [@ryguy](https://forum.ansible.com/u/ryguy)\
**Post date:** [May 6, 2024, 9:59pm UTC](https://forum.ansible.com/t/using-molecule-with-multi-role-repositories/5211/4 "2024-05-06T21:59:33Z")

</div>

I don’t have a perfect answer for you, but my team does this in our repo and we’ll have a molecule dir in each role w/ its own molecule.yml config and scenarios and we’ll kick it off with tox.

since molecule.yml supports shell variable substitution/parameter expansion it works hand-in-hand with tox pretty well to take env vars for instance names and the like so that you don’t have to completely make every moleucle.yml from scratch and either control things through env vars that get picked up by tox or have a different tox env for each role if that makes sense.
