# Weirdness when testing include\_role

**URL:** <https://forum.ansible.com/t/weirdness-when-testing-include-role/22708>\
**Category:** Ansible Project\
**Created:** [October 3, 2016, 8:24pm UTC](https://forum.ansible.com/t/weirdness-when-testing-include-role/22708 "2016-10-03T20:24:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [October 3, 2016, 8:24pm UTC](https://forum.ansible.com/t/weirdness-when-testing-include-role/22708/1 "2016-10-03T20:24:49Z")

</div>

Just a quick question regarding the include\_role thing:

It seems that the “name” of the include\_role task needs to match the role name, is anybody else seeing the same? For example, if my role is called “myrole”, then this doesnt work:

---

<div class="post-metadata">

**Author:** ![Dave\_Kindel](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@Dave\_Kindel](https://forum.ansible.com/u/Dave_Kindel)\
**Post date:** [October 3, 2016, 8:32pm UTC](https://forum.ansible.com/t/weirdness-when-testing-include-role/22708/2 "2016-10-03T20:32:27Z")

</div>

I haven’t messed around with it but according to their examples, your first test should have worked.

From the docs:

```auto
- name: Run tasks/other.yml instead of 'main'
  include_role:
    name: myrole
    tasks_from: other

```

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 3, 2016, 10:22pm UTC](https://forum.ansible.com/t/weirdness-when-testing-include-role/22708/3 "2016-10-03T22:22:19Z")

</div>

​Sounds like a bug, probably my fault for reusing name on the object and bad tests:

- name: myrole  
include\_role: name=myrole

…
