# The future of deep collection folder structures

**URL:** <https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648>\
**Category:** Ansible Developer\
**Created:** [February 10, 2023, 7:09pm UTC](https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648 "2023-02-10T19:09:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli\_Wolf](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@Uli\_Wolf](https://forum.ansible.com/u/Uli_Wolf)\
**Post date:** [February 10, 2023, 7:09pm UTC](https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648/1 "2023-02-10T19:09:18Z")

</div>

Dear Ansible Developers,

We developed quite a number of collections which utilize the deep folder structure to organize the content. Example:

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [February 10, 2023, 7:53pm UTC](https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648/2 "2023-02-10T19:53:42Z")

</div>

Hi Uli,

> We developed quite a number of collections which utilize the deep  
> folder structure to organize the content. Example:
> 
> #################################  
> ├── playbooks/  
> │ ├── db/  
> │ │ ├── client/  
> │ │ │ └── deploy\_software.yml  
> │ │ └── server/  
> │ │ └── deploy\_software.yml  
> │ └── ...  
> ├── plugins/  
> │ ├── action/  
> │ │ ├── db/  
> │ │ │ └── foo.py  
> │ │ └── app/  
> │ │ └── backend/  
> │ │ └── api.py  
> │ └── ...  
> └── ...  
> #################################
> 
> To us the benefit is the clear organization of plugins and playbooks  
> (among many other nice things).
> 
> Recently many of the community collections have been reorganized  
> (afaik by Felix Fontein) to have a flat structure again. On the other  
> hand tools like ansible-lint have been fixed to fully support deep  
> structures.
> 
> My questions to you is: What the the future of deep structures in  
> collections?

deep structures are fully supported. (I don't know whether they work  
for playbooks or roles - I've never tried them there - but they  
definitely work for plugins and modules, and I'm not aware of any plans  
to change that.)

The reason we removed that structure for community.general and  
community.network was that the structure there was never intended to be  
seen by users. It was only used to structure the content of the  
collection (c.g has 568 modules) so modules covering similar topics are  
in the same directory, making development of the collection easier.

Since it was no longer possible to hide this from users, we decided to  
remove the structure.

Best regards,  
Felix

---

<div class="post-metadata">

**Author:** ![Uli\_Wolf](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@Uli\_Wolf](https://forum.ansible.com/u/Uli_Wolf)\
**Post date:** [February 10, 2023, 8:11pm UTC](https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648/3 "2023-02-10T20:11:56Z")

</div>

Hi Felix,

Thanks for your quick reply and that is great!

We actually love deep structures and are very happy to hear that they are not going away. Btw they work perfectly for playbooks as well (haven’t tried it for roles though).

Thanks again & best regards,  
Uli

Hi Uli,

> We developed quite a number of collections which utilize the deep  
> folder structure to organize the content. Example:
> 
> #################################  
> ├── playbooks/  
> │ ├── db/  
> │ │ ├── client/  
> │ │ │ └── deploy\_software.yml  
> │ │ └── server/  
> │ │ └── deploy\_software.yml  
> │ └── …  
> ├── plugins/  
> │ ├── action/  
> │ │ ├── db/  
> │ │ │ └── foo.py  
> │ │ └── app/  
> │ │ └── backend/  
> │ │ └── api.py  
> │ └── …  
> └── …  
> #################################
> 
> To us the benefit is the clear organization of plugins and playbooks  
> (among many other nice things).
> 
> Recently many of the community collections have been reorganized  
> (afaik by Felix Fontein) to have a flat structure again. On the other  
> hand tools like ansible-lint have been fixed to fully support deep  
> structures.
> 
> My questions to you is: What the the future of deep structures in  
> collections?

deep structures are fully supported. (I don’t know whether they work  
for playbooks or roles - I’ve never tried them there - but they  
definitely work for plugins and modules, and I’m not aware of any plans  
to change that.)

The reason we removed that structure for community.general and  
community.network was that the structure there was never intended to be  
seen by users. It was only used to structure the content of the  
collection (c.g has 568 modules) so modules covering similar topics are  
in the same directory, making development of the collection easier.

Since it was no longer possible to hide this from users, we decided to  
remove the structure.

Best regards,  
Felix

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 21, 2023, 4:32pm UTC](https://forum.ansible.com/t/the-future-of-deep-collection-folder-structures/37648/4 "2023-02-21T16:32:27Z")

</div>

While we support the deep structures, we do not recommend their use,  
having more small more targeted collections is generally better than  
having one huge one. community.general itself is an exception as it  
was a dumping ground for all the old core plugins that could not find  
a home in their own collection.
