Module not found when using collection

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/) 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.

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

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.

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

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.