ansible fail to find module in "library" path if its a directory #46004
Labels
affects_2.6
This issue/PR affects Ansible v2.6
bug
This issue/PR relates to a bug.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
I'm trying to use hashivault module and it works fine when installed in the system module path:
/usr/lib/python2.7/dist-packages/ansible/modules/hashivault
But i want to make this more portable and not require users to install software, so i tried to set the
library
to the extras/plugins/modules , but it fails to find the moduleAs per #15432, i tried to load multiple paths:
library=extras/plugins/modules:extras/plugins/modules/hashivault
but ansible still fails to find the module
the error is this:
the lookup code imports the hashivault using this code:
from ansible.modules.hashivault import hashivault_read
even trying to install the module in $HOME/.ansible/plugins will fail, i can only make this work if the module is installed in the system and strace show that ansible is not even trying to find it in other places.
ISSUE TYPE
COMPONENT NAME
modules
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 18.04.1 LTS using
http://ppa.launchpad.net/ansible/ansible/ubuntu
STEPS TO REPRODUCE
Download the https://github.com/TerryHowe/ansible-modules-hashivault/ and install it in the user $HOME/.ansible path
make sure you have the lookup hashivault.py in the lookup seach path
try to do a
{{ lookup('hashivault', 'openvpn/test', 'value') | default('', true) }}
even without vault and any config, ansible should load the lookup module, but then errors about missing module
EXPECTED RESULTS
It should try to load hashivault and error about missing parameters
ACTUAL RESULTS
It fails to load the module because its a directory and have not any hashivault.py file as module
It do not try to load it from any other place, even when it reports this
configured module search path = [u'/home/dleite/ansible/extras/plugins/modules', u'/home/dleite/ansible/extras/plugins/modules/hashivault']
The strace shows that in the beginning, ansible do a stat on the correct directories, but fail to load it later on:
The text was updated successfully, but these errors were encountered: