# Is there a reason for forcing verbose directory structure inside roles?

**URL:** <https://forum.ansible.com/t/is-there-a-reason-for-forcing-verbose-directory-structure-inside-roles/16676>\
**Category:** Ansible Project\
**Created:** [November 3, 2014, 9:37pm UTC](https://forum.ansible.com/t/is-there-a-reason-for-forcing-verbose-directory-structure-inside-roles/16676 "2014-11-03T21:37:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teemu\_Kurppa](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@Teemu\_Kurppa](https://forum.ansible.com/u/Teemu_Kurppa)\
**Post date:** [November 3, 2014, 9:37pm UTC](https://forum.ansible.com/t/is-there-a-reason-for-forcing-verbose-directory-structure-inside-roles/16676/1 "2014-11-03T21:37:11Z")

</div>

Hi,

continuing discussion from Twitter:  
[https://twitter.com/Teemu/status/529356262862241792](https://twitter.com/Teemu/status/529356262862241792)

Is there a reason for forcing verbose directory structure inside roles?

When making roles for internal purposes, I often start with a playbook and after it grows more complex I move a part of the functionality inside a new role. However, most roles are rather simple and need just a couple of files or even just tasks/main.yml if I keep most of the things hardcoded in the beginning. The forced directory structure with

roles/myrole/tasks/main.yml  
roles/myrole/vars/main.yml,

… seems unnecessarily deep and verbose. It seems that for simpler roles something like

roles/myrole/tasks.yml

roles/myrole/vars.yml

would be enough. Or we could go even simpler, just a single main.yml in the beginning:

roles/myrole/main.yml

and then refactor when the role grows more complex.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 5, 2014, 2:22pm UTC](https://forum.ansible.com/t/is-there-a-reason-for-forcing-verbose-directory-structure-inside-roles/16676/2 "2014-11-05T14:22:05Z")

</div>

Yes…

This has been brought up 1-2 times before.

At some point, roles will expand and need to include other files, things like include\_vars, multiple templates, etc.

This enforces a standard where everybody’s roles follow a common convention.

–Michael
