# Why does include/import\_role require a name argument?

**URL:** <https://forum.ansible.com/t/why-does-include-import-role-require-a-name-argument/32228>\
**Category:** Ansible Project\
**Created:** [February 13, 2020, 10:13pm UTC](https://forum.ansible.com/t/why-does-include-import-role-require-a-name-argument/32228 "2020-02-13T22:13:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_Alegre](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@M\_Alegre](https://forum.ansible.com/u/M_Alegre)\
**Post date:** [February 13, 2020, 10:13pm UTC](https://forum.ansible.com/t/why-does-include-import-role-require-a-name-argument/32228/1 "2020-02-13T22:13:17Z")

</div>

Hello,

I know this is a relatively frivolous concern, but it’s really bugging me.

If I want to import a playbook foo.yml I can just pass it directly:

```auto
- include_playbook: foo.yml

```

Similarly with tasks:

```auto
tasks:
- include_tasks: foo.yml

```

However, if I want to import a role named “foo”, I can’t write:

```auto
tasks:
- include_role: foo

```

but instead I have to write:

```auto
tasks:
- include_role:
name: foo

```

Is there a technical reason why `include_role` behaves differently from other includes? Because if there isn’t, I might submit a feature request for it to behave the same as other includes . . .

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 13, 2020, 10:20pm UTC](https://forum.ansible.com/t/why-does-include-import-role-require-a-name-argument/32228/2 "2020-02-13T22:20:26Z")

</div>

Supporting what we call raw params, so that you don’t need `name` makes it technically more complicated for the module to accept other args. Such as `defaults_from`.

In general we are moving away from those things which just accept a simple string value. We already started this with include\_tasks. Where it now can accept an argument called `file`. Eventually support for the simple string value may be removed.

If anything we would go the opposite of your idea.

---

<div class="post-metadata">

**Author:** ![M\_Alegre](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@M\_Alegre](https://forum.ansible.com/u/M_Alegre)\
**Post date:** [February 14, 2020, 4:06am UTC](https://forum.ansible.com/t/why-does-include-import-role-require-a-name-argument/32228/3 "2020-02-14T04:06:00Z")

</div>

I see. Well, at least the plan is for it to be consistent! It was the inconsistency that was bugging me more than anything.
