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

23 views
Skip to first unread message

Teemu Kurppa

unread,
Nov 3, 2014, 4:37:11 PM11/3/14
to ansible...@googlegroups.com
Hi, 

continuing discussion from Twitter:

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. 





Michael DeHaan

unread,
Nov 5, 2014, 9:22:12 AM11/5/14
to ansible...@googlegroups.com
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



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6348a390-dc03-4ca9-ad0e-bf630f86de9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages