# Roles not found when executing include\_role within a "ansible-test integration" execution

**URL:** <https://forum.ansible.com/t/roles-not-found-when-executing-include-role-within-a-ansible-test-integration-execution/36708>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [June 9, 2022, 2:03pm UTC](https://forum.ansible.com/t/roles-not-found-when-executing-include-role-within-a-ansible-test-integration-execution/36708 "2022-06-09T14:03:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Bartsch](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Tom\_Bartsch](https://forum.ansible.com/u/Tom_Bartsch)\
**Post date:** [June 9, 2022, 2:03pm UTC](https://forum.ansible.com/t/roles-not-found-when-executing-include-role-within-a-ansible-test-integration-execution/36708/1 "2022-06-09T14:03:54Z")

</div>

Hi there,

I tried to start a integration test for my collection with “ **ansible-test integration** ”. Within the main.yml of my tests/integration/targets/logrotate\_test/tasks/ directory I use this ansible task:

**- name: Prepare test**  
**include\_role:**  
**name: “{{ item }}”**  
**loop:**  
**- sit\_lnx\_certs**  
**- sit\_lnx\_repo\_rhel**  
**- sit\_lnx\_repo\_epel**

This task I have because my collection is dependend on these roles. So this roles must run before my collection does. So I tried to include them. Before running the test I installed the roles via ansible-galaxy role install. The roles are installed correctly within ~/.ansible/roles/ directory.

When I run the integration test now with  
**ansible-test integration --docker centos8**  
it tells me that the integration test can’t find my roles:

ERROR! the role ‘sit\_lnx\_certs’ was not found in sit\_lnx.logrotate:ansible.legacy:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/roles:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/targets:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration ERROR! the role ‘sit\_lnx\_repo\_rhel’ was not found in sit\_lnx.logrotate:ansible.legacy:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/roles:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/targets:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration ERROR! the role ‘sit\_lnx\_repo\_epel’ was not found in sit\_lnx.logrotate:ansible.legacy:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/roles:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration/targets:/root/ansible\_collections/sit\_lnx/logrotate/tests/output/.tmp/integration/logrotate\_test-hb1i7wz6-ÅÑŚÌβŁÈ/tests/integration

So I am not able to understand why and where this integration test searches for the roles. And I don’t know how I can tell ansible-test where it gets the needed roles from git. Could someone help and tell me what I am doing wrong?

I am using **ansible [core 2.11.12].**

Kindly Regards,  
Tom
