# How to use Custom Module in sub directory of library folder (git submodule)

**URL:** <https://forum.ansible.com/t/how-to-use-custom-module-in-sub-directory-of-library-folder-git-submodule/30630>\
**Category:** Ansible Project\
**Created:** [June 21, 2019, 3:31pm UTC](https://forum.ansible.com/t/how-to-use-custom-module-in-sub-directory-of-library-folder-git-submodule/30630 "2019-06-21T15:31:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Snapp](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@Jacob\_Snapp](https://forum.ansible.com/u/Jacob_Snapp)\
**Post date:** [June 21, 2019, 3:31pm UTC](https://forum.ansible.com/t/how-to-use-custom-module-in-sub-directory-of-library-folder-git-submodule/30630/1 "2019-06-21T15:31:07Z")

</div>

Hi,

I would like to use git submodules to import custom modules into my roles. However, I am having difficulties in getting Ansible to find my nested module.

In this issue on [https://github.com/ansible/ansible/issues/16561#event-2428527915](https://github.com/ansible/ansible/issues/16561#event-2428527915) bcoca suggests using an **init**.py file but I am having no luck.

├── library  
│ └── validate\_schema  
│ ├── README.md  
│ ├── **init**.py  
│ └── validate\_schema.py

Anyone done something similar?

Cheers,  
Jacob

---

<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:** [July 5, 2019, 2:23pm UTC](https://forum.ansible.com/t/how-to-use-custom-module-in-sub-directory-of-library-folder-git-submodule/30630/2 "2019-07-05T14:23:03Z")

</div>

the \_\_init\_\_.py has to exist in library/, its following a python  
import path, so it needs that in each 'intermediate' directory from  
the expected root
