# Module not found when using collection

**URL:** <https://forum.ansible.com/t/module-not-found-when-using-collection/34408>\
**Category:** Ansible Project\
**Created:** [January 7, 2021, 1:58pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408 "2021-01-07T13:58:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yanis\_Boucherit](https://avatars.discourse-cdn.com/v4/letter/y/50afbb/32.png) [@Yanis\_Boucherit](https://forum.ansible.com/u/Yanis_Boucherit)\
**Post date:** [January 7, 2021, 1:58pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408/1 "2021-01-07T13:58:50Z")

</div>

I’m working with Ansible, I made a collection with some roles, all is working flawlessly, I can use my roles etc. until recently.

I tried to use the hashivault\_write and hashivault\_read modules ([https://pypi.org/project/ansible-modules-hashivault/](https://pypi.org/project/ansible-modules-hashivault/)) but it seems it’s not working when I used them in roles **from** my collection.

ERROR! couldn’t resolve module/action ‘hashivault\_write’.  
This often indicates a misspelling, missing collection, or incorrect module path. The error appears to be in  
‘/home/xxxx/.ansible/collections/ansible\_collections/xx/roles/roles/postfix/tasks/opendkim.yml’: line 92, column 3, but may be elsewhere in the file depending on the exact syntax problem.  
The offending line appears to be:

## Write opendkim private key in vault - name: “Write in vault”

^ here

When the **exact** same role is used outside the collection (straight from ansible roles/ folder) I don’t have this issue. I guess the problem is not the module installation because it’s working from outside the collection.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 7, 2021, 2:07pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408/2 "2021-01-07T14:07:05Z")

</div>

There was a breaking change lately in that module, maybe that is the problem

[https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst#breaking-changes–porting-guide](https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst#breaking-changes--porting-guide)

---

<div class="post-metadata">

**Author:** ![Yanis\_Boucherit](https://avatars.discourse-cdn.com/v4/letter/y/50afbb/32.png) [@Yanis\_Boucherit](https://forum.ansible.com/u/Yanis_Boucherit)\
**Post date:** [January 7, 2021, 2:17pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408/3 "2021-01-07T14:17:35Z")

</div>

Thanks for the answer, but unfortunately it seems the breaking changes are about the hasi\_vault lookup plugin and not the hashivault\_write and hashivault\_read modules which are different from community.hashi\_vault.

---

<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:** [January 7, 2021, 2:45pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408/4 "2021-01-07T14:45:34Z")

</div>

Hi all,

> Thanks for the answer, but unfortunately it seems the breaking  
> changes are about the hasi\_vault lookup plugin

more precisely, the breaking change affects the hashi\_vault lookup  
plugin in the collection community.hashi\_vault. If you simply use  
'hashi\_vault' without a FQCN, you are using the hashi\_vault plugin from  
community.general.

For community.general 2.0.0 (contained in Ansible 3.0.0), the  
hashi\_vault plugin will be removed and it will be redirected to the one  
in the community.hashi\_vault collection. So the breaking change will  
only affect Ansible 3.0.0, or users who decide to already use the  
community.hashi\_vault collection.

About the original question: I guess it depends on where you placed the  
hashivault\_write / hashivault\_read modules.

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Yanis\_Boucherit](https://avatars.discourse-cdn.com/v4/letter/y/50afbb/32.png) [@Yanis\_Boucherit](https://forum.ansible.com/u/Yanis_Boucherit)\
**Post date:** [January 7, 2021, 2:53pm UTC](https://forum.ansible.com/t/module-not-found-when-using-collection/34408/5 "2021-01-07T14:53:26Z")

</div>

Thanks for the answer,  
I tried to installed the module first with pip and then with ansible-galaxy install.  
I’m not really sure it is an installation problem because when I’m using the module in the same role outside my collection, it works perfectly.
