# parent role name in name of task bug with includes ?

**URL:** <https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516>\
**Category:** Ansible Project\
**Created:** [September 20, 2013, 2:05pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516 "2013-09-20T14:05:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [September 20, 2013, 2:05pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516/1 "2013-09-20T14:05:58Z")

</div>

For information,

I have a role for which in role/r/tasks/main.yml I include tasks from a file.  
All the included tasks seem to miss the “r|” in their name.

it seems like a bug.

Jerome

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [September 20, 2013, 2:32pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516/2 "2013-09-20T14:32:02Z")

</div>

Yes, I will modify the patch, that is indeed an unintended consequence.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [September 20, 2013, 2:35pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516/3 "2013-09-20T14:35:15Z")

</div>

That should be fixed if you’d like to pull and re-test.

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [September 20, 2013, 2:36pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516/4 "2013-09-20T14:36:10Z")

</div>

Hello,

I was looking in the code while you answered. The problem might be in playbook/play.py :

new\_role = None  
if ‘role\_name’ in x:  
new\_role = x[‘role\_name’]

instead of

new\_role = role\_name  
if ‘role\_name’ in x:  
new\_role = x[‘role\_name’]

hope this helps

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [September 20, 2013, 2:42pm UTC](https://forum.ansible.com/t/parent-role-name-in-name-of-task-bug-with-includes/13516/5 "2013-09-20T14:42:43Z")

</div>

This is really more of a discussion for ansible-devel, but yes that’s the part that was causing it, however the change I did was this:

if os.path.isfile(handler):

- nt = dict(include=pipes.quote(handler), vars=role\_vars, role\_name=role[‘role’])

- nt = dict(include=pipes.quote(handler), vars=role\_vars)

Since the role name does not exist in the data, it won’t be pre-pended to the handler’s task name, so the notifications should be able to find it once again.
