# more weirdness when testing include\_role

**URL:** <https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709>\
**Category:** Ansible Project\
**Created:** [October 3, 2016, 8:36pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709 "2016-10-03T20:36:51Z")\
**Posts on this page:** 7\
**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:36pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/1 "2016-10-03T20:36:51Z")

</div>

Here’s another oddity. As far as I can see from the docs, this should work (“myrole” lives in roles/myrole in the plabook folder)

---

<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, 11:22pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/2 "2016-10-03T23:22:17Z")

</div>

I just updated it to add \_role\_name and use that instead of name (which it was conflating with the task level one), make sure you don’t have old .pyc files.

---

<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 4, 2016, 6:03am UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/3 "2016-10-04T06:03:19Z")

</div>

Sweet! Will retest

---

<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 4, 2016, 12:18pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/4 "2016-10-04T12:18:01Z")

</div>

So, I’m testing on the latest devel (up to date as of right now). If I omit the “name” prop I get the error “ERROR! ‘name’ is a required field.”

Playbook:

---

<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 4, 2016, 1:35pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/5 "2016-10-04T13:35:52Z")

</div>

Sorry for the confusion, \_role\_name is internal, you need to set name:

- include\_role:  
name: myrole

---

<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 4, 2016, 1:54pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/6 "2016-10-04T13:54:53Z")

</div>

Ah, gotcha. Thanks.

I’m still struggling to get with\_items to work tho. Trying this:

---

<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 6, 2016, 9:12pm UTC](https://forum.ansible.com/t/more-weirdness-when-testing-include-role/22709/7 "2016-10-06T21:12:35Z")

</div>

Just tested this with the latest devel and still no luck. Should this work?
