Welcome, Guest! Registration

loc2log

Thursday, 2024-04-25
Main » 2016 » September » 08

You may be seeing this on your fresh ansible install when executing under your own login:

ansible --version
Traceback (most recent call last):
  File "/usr/bin/ansible", line 39, in <module>
    from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
ImportError: No module named ansible.errors

But, it works just fine when you execute it from sudo or root.

The issue is too tight permissions on /usr/lib/python2.6/site-packages/ansible/errors (and probably other modules too) set when you installed ansible using: sudo pip install ansible.

The remedy is to become root with login shell:

sudo su -
pip uninstall ansible
pip install ansible

If that does not help and permissions on /usr/lib/python2.6/site-packages/ansible/errors are still not good, then
a. have a long hard look at umasks,
or
b. set permissions in whole /usr/lib/python2.6/site-packages/ansible/ to make files and dirs. accessible to everyone, or to at least your group (find . -name/-type -exec is your friend).

Note: Your /usr/lib/python path maybe different depending on your Python version.

Views: 5291 | Added by: ep | Date: 2016-09-07 | Comments (0)