Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
682 views
in Technique[技术] by (71.8m points)

roles - Ansible : 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...