Ansible "module not found"

(Dennis Wisnia) #1

Hello everybody,

after upgrading to ansible, I am getting the error, that a lot of modules not found:

Using module file /usr/local/Cellar/ansible/
<xxxxx> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626 `" && echo ansible-tmp-1484207252.67-266217899604626="` echo $HOME/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626 `" ) && sleep 0'
<xxxxx> PUT /var/folders/sq/dwgktc691cq4hsp0_6yb16980000gn/T/tmpYQT3Mu TO /Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/
<xxxxx> EXEC /bin/sh -c 'chmod u+x /Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/ /Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/ && sleep 0'
<xxxxx> EXEC /bin/sh -c '/usr/bin/python /Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/; rm -rf "/Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/var/folders/sq/dwgktc691cq4hsp0_6yb16980000gn/T/ansible_DevDXg/", line 25, in <module>
import yum
ImportError: No module named yum

failed: [] (item=[u'postgresql95', u'libpq-devel', u'python-psycopg2']) => {
"failed": true,
"invocation": {
    "module_name": "yum"
"item": [
"module_stderr": "Traceback (most recent call last):\n  File \"/var/folders/sq/dwgktc691cq4hsp0_6yb16980000gn/T/ansible_DevDXg/\", line 25, in <module>\n    import yum\nImportError: No module named yum\n",
"module_stdout": "",

other modules like yum_repository working fine.

What I already did:

  • Reinstalled via brew
  • Reinstalled via pip

I am running Mac OS X Sierra.

If you need additional Informations, let me know.

(Mike McQuaid) #2

What version did you upgrade from? Can you reproduce this with pip install ansible?

(Andreacasini) #3

I experienced the same problem.

I learned that Ansible is badly broken, I had to fall back to (because that’s the option I found with brew) and now it’s all good again.

It would be nice to be able to go back to because 2.2 supports python 3+ while 2.0 doesn’t.

(Andreacasini) #4

I can confirm if you install with pip you have the same issue.

I fixed it installing it via pip as follows:
sudo pip install ansible==