Why does include/import_role require a name argument?

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:

- include_playbook: foo.yml

Similarly with tasks:

tasks:
- include_tasks: foo.yml

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

tasks:
- include_role: foo

but instead I have to write:

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 . . .

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.

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