Reputation: 663
I'm having issues with Ansible picking up a module that I've added.
library = /usr/share/ansible/modules
and adding the module files there and still doesn't get picked up.ANSIBLE_LIBRARY=/usr/share/ansible/modules
My Ansible playbook looks like this:
---
- name: example play
hosts: all
gather_facts: false
tasks:
- name: set password
debug: msg="{{ lookup('passwordstore', 'files/test create=true')}}"
And when I run this I get this error;
ansible-playbook main.yml
PLAY [example play] ******************************************************
TASK [set password] ************************************************************
fatal: [backend.example.name]: FAILED! => {"failed": true, "msg": "lookup plugin (passwordstore) not found"}
fatal: [mastery.example.name]: FAILED! => {"failed": true, "msg": "lookup plugin (passwordstore) not found"}
to retry, use: --limit @/etc/ansible/roles/test-role/main.retry
Any guidance on what I'm missing? It may just be the way in which I'm trying to add the custom module, but any guidance would be appreciated.
Upvotes: 0
Views: 4388
Reputation: 68509
It's a lookup plugin (not a module), so it should go into a directory named lookup_plugins
(not library
).
Alternatively, add the path to the cloned repository in ansible.cfg
using the lookup-plugins
setting.
Upvotes: 4