# looking for feedback on an idea for a PR

**URL:** <https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085>\
**Category:** Ansible Developer\
**Tags:** galaxy-ng\
**Created:** [March 28, 2017, 4:24pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085 "2017-03-28T16:24:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelconlon0](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@michaelconlon0](https://forum.ansible.com/u/michaelconlon0)\
**Post date:** [March 28, 2017, 4:24pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/1 "2017-03-28T16:24:54Z")

</div>

At my company, we currently use a patch file to get this result, and it’s been working great for over a year…so I figured it might be worth submitting a PR. However, I’m not sure how it would be received from a design perspective. Here’s the change:

We got tired of having dozens of main.yml files open in our editors (and buried as a single file inside of a directory), so we made a patch that allows the default loading mechanism of these files in roles:  
tasks/main.yml  
defaults/main.yml  
handlers/main.yml  
meta/main.yml

to also load these files:  
tasks.yml  
defaults.yml  
handlers.yml  
meta.yml

This makes it a lot easier to navigate and edit files in our ansible project. No more opening directories just to look at that one main.yml file inside. No more cycling through all the main.yml tabs in our editor to find the tasks file we were just working on.

This role:

roles/dnsmasq/  
├── defaults  
│ └── main.yml

├── handlers  
│ └── main.yml

├── meta  
│ └── main.yml

├── tasks  
│ └── main.yml

└── templates  
├── dns.conf.j2  
├── logrotate.j2  
└── supervisord.j2

now becomes:

roles/dnsmasq/  
├── defaults.yml  
├── handlers.yml  
├── meta.yml  
├── tasks.yml  
└── templates  
├── dns.conf.j2  
├── logrotate.j2  
└── supervisord.j2

Our patch doesn’t break anything about the standard functionality of roles, so we can just as easily use roles downloaded from Galaxy.

So…thoughts? Worth a PR?

---

<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:** [March 28, 2017, 4:28pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/2 "2017-03-28T16:28:22Z")

</div>

Historically speaking, we have turned down all PRs and issues that wish to make this change.

---

<div class="post-metadata">

**Author:** ![michaelconlon0](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@michaelconlon0](https://forum.ansible.com/u/michaelconlon0)\
**Post date:** [March 28, 2017, 4:35pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/3 "2017-03-28T16:35:17Z")

</div>

Thanks, I had a feeling that was the case, which was why I didn’t go ahead and create the PR. I’m sure the reasoning is out there somewhere, but if you could link me to it, I’d appreciate it. I’m trying to understand why exactly it gets turned down, especially when it’s not breaking existing convention. This change makes things so much more readable…

---

<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:** [March 28, 2017, 4:39pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/4 "2017-03-28T16:39:48Z")

</div>

My quick search on github lead me to [https://github.com/ansible/ansible/issues/4359](https://github.com/ansible/ansible/issues/4359)

It mentions “discussed in the past” but I didn’t immediately find that discussion. There may actually be discussions on this mailing list, I’m unsure.

---

<div class="post-metadata">

**Author:** ![michaelconlon0](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@michaelconlon0](https://forum.ansible.com/u/michaelconlon0)\
**Post date:** [March 28, 2017, 5:07pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/5 "2017-03-28T17:07:09Z")

</div>

Thanks for the link!

---

<div class="post-metadata">

**Author:** ![Scott\_Mcdermott](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Scott\_Mcdermott](https://forum.ansible.com/u/Scott_Mcdermott)\
**Post date:** [March 28, 2017, 5:11pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/6 "2017-03-28T17:11:42Z")

</div>

This idea has been knocked down many times, for no good reason. I  
have previously found, when searching on this topic, many occurrences  
of the original author (DeHaan) in forums and issues basically just  
saying "no" and the rationale was always "because I said so" or  
"because I said so before." Any attempts to argue were met with "this  
is a dead horse. Stop beating it." If you dig, you'll see the claim  
that it's more "scalable" to use the full layout, but all the  
counter-arguments -- that most/all roles only have single main.yml  
files in these dirs, that it makes people confused by the layout, that  
it makes editing more difficult, that it's superfluous structure in  
the vast majority of cases -- were just met with a dictate. Ansible  
can't be all things to all people, it was said. We follow  
conventions. That ship has sailed.

Several of my colleagues have told me, when teaching them about  
Ansible -- and I have thought myself -- how silly it is to have all  
these directories with single files in them. Out of dozens of roles  
so far, I have only had occasion a few times to populate these  
directories with anything but single main.yml files. The  
documentation is always encouraging users to factorize our plays into  
roles, but well-factored roles will (almost by definition) be small  
and use single main.yml files in defaults/, tasks/, meta/, etc, so I  
find this contradictory.

My guess is that the core development team still holds this opinion --  
for whatever reason -- and this change will never happen. If you  
forked ansible with this patch (is it available btw?), I'd use your  
fork 🙂 I personally think it is the most inelegant aspect of  
ansible, but opinions differ...

---

<div class="post-metadata">

**Author:** ![michaelconlon0](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@michaelconlon0](https://forum.ansible.com/u/michaelconlon0)\
**Post date:** [March 28, 2017, 9:00pm UTC](https://forum.ansible.com/t/looking-for-feedback-on-an-idea-for-a-pr/24085/7 "2017-03-28T21:00:43Z")

</div>

Scott, I completely agree with you, and you put it extremely well. I’m baffled at the stubbornness that seems to run counter to the project’s own design goals.

I don’t have a fork of ansible at this time, but I can share our patch with you now (this is based off of v2.2.1.0-1)…just copy the patch below to a local file and run patch -N \<path\_to\_src\>/ansible/lib/ansible/playbook/role/ **init**.py patch\_file.patch

Here’s patch\_file.patch:

\*\*\* ansible\_221/src/ansible/lib/ansible/playbook/role/ **init**.py 2017-03-28 10:46:37.000000000 -0500  
— role\_init.py 2017-03-28 12:53:13.000000000 -0500
