Ansible 2.2.0.0_2 "module not found"


(Dennis Wisnia) #1

Hello everybody,

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

Using module file /usr/local/Cellar/ansible/2.2.0.0_2/libexec/lib/python2.7/site-packages/ansible/modules/core/packaging/os/yum.py
<xxxxx> ESTABLISH LOCAL CONNECTION FOR USER: xxxxx
<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/yum.py
<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/yum.py && sleep 0'
<xxxxx> EXEC /bin/sh -c '/usr/bin/python /Users/xxxxx/.ansible/tmp/ansible-tmp-1484207252.67-266217899604626/yum.py; 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/ansible_module_yum.py", line 25, in <module>
import yum
ImportError: No module named yum

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

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 2.2.0.0 is badly broken, I had to fall back to 2.0.2.0 (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 2.2.1.0 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==2.2.1.0