I have ansible (v2.0.0.2) and python (v2.7.6) and i'm running the 'maven_artifact' module.
As a direct ansible command, it works fine
ansible localhost -m maven_artifact -a "group_id=commons-collections artifact_id=commons-collections dest=/tmp/commons-collections-latest.jar" -vvvv
but when i do the same via a playbook
- name: download via maven
maven_artifact: group_id=junit artifact_id=junit dest=/tmp/junit-latest.jar
it fails with this error
fatal: [test01vm1]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "maven_artifact"},
"module_stderr": "",
"module_stdout": "\r\nTraceback (most recent call last):\r\n
File \"/home/admin123/.ansible/tmp/ansible-tmp-1454675562.75-201853614879442/maven_artifact\",
line 25, in <module>\r\n from lxml import etree\r\nImportError:
No module named lxml\r\n", "msg": "MODULE FAILURE", "parsed": false}
I believe might be related to the python lxml module, and i found these existing tickets
http://stackoverflow.com/questions/13355984/get-errors-when-import-lxml-etree-to-python
http://stackoverflow.com/questions/4598229/installing-lxml-module-in-python
I'm wondering might someone have a workaround for this?
EDIT - Add python path details
I ran this command to see what path's are on the python home
14:55:11@pcZBook-15:/usr/local/etc$ python -c 'import sys; print(":".join(sys.path))'
The list of folders is
:/opt/stack/keystone
:/opt/stack/glance
:/opt/stack/cinder
:/opt/stack/nova
:/opt/stack/horizon
:/usr/lib/python2.7
:/usr/lib/python2.7/plat-x86_64-linux-gnu
:/usr/lib/python2.7/lib-tk
:/usr/lib/python2.7/lib-old
:/usr/lib/python2.7/lib-dynload
:/usr/local/lib/python2.7/dist-packages
:/usr/lib/python2.7/dist-packages
:/usr/lib/python2.7/dist-packages/PILcompat
:/usr/lib/python2.7/dist-packages/gtk-2.0
:/usr/lib/pymodules/python2.7
:/usr/lib/python2.7/dist-packages/ubuntu-sso-client
:/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode