One host in an Inventory fail "MODULE FAILURE", all others works?

48 views
Skip to first unread message

Jéan Roux

unread,
Dec 16, 2017, 3:45:25 PM12/16/17
to Ansible Project
Hi, I am new to Ansible. I am testing simple ansible script like "ansible -m shell -a 'df -h' all -i hosts-file.ini" with several Raspberry Pi's. All come back successfully, accept one host, on any type of command, it looks like below, (the ssh keys works, I can log into the host, etc.)
-------------------------------------------------------------------------------------------------------------

host1 | FAILED! => {

    "changed": false, 

    "module_stderr": "Shared connection to iotplay.asuscomm.com closed.\r\n", 

    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/pi/.ansible/tmp/ansible-tmp-1513456624.46-27928346050531/command.py\", line 18, in <module>\r\n    import tempfile\r\n  File \"/usr/lib/python2.7/tempfile.py\", line 35, in <module>\r\n    from random import Random as _Random\r\nEOFError: EOF read where object expected\r\n", 

    "msg": "MODULE FAILURE", 

    "rc": 0

}

-------------------------------------------------------------------------------------------------------------
Can someone point me in the right direction to solve this please? 

Jéan Roux

unread,
Dec 16, 2017, 3:51:25 PM12/16/17
to Ansible Project
Version, on a Mac:

ansible --version

ansible 2.4.2.0

  config file = None

  configured module search path = [u'/Users/jean/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /Library/Python/2.7/site-packages/ansible

  executable location = /usr/local/bin/ansible

  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]


Jéan Roux

unread,
Dec 16, 2017, 4:19:50 PM12/16/17
to Ansible Project
One suggestion on the web I found, here, https://github.com/ansible/ansible/issues/21468, proposes:

ansible -m ping all -i hosts-file.ini -e ansible_python_interpreter=/usr/bin/python2.7

This also does not work.

Jéan Roux

unread,
Dec 16, 2017, 4:25:32 PM12/16/17
to Ansible Project
This website https://www.josharcher.uk/code/ansible-python-connection-failure-ubuntu-server-1604/ recons, for Ubuntu, one must install Python 2.7.

I do not think this is the problem, as the other hosts does work.

Dick Visser

unread,
Dec 23, 2017, 5:33:28 AM12/23/17
to ansible...@googlegroups.com
This sounds like some sort of integrity problem with python on that host.
Try to check the affected files it’s complainig about, or try apt-get purge the package and reinstall.

Dick


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/45c710ee-d153-4877-8e97-3849acb618f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Dick Visser
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs
Reply all
Reply to author
Forward
0 new messages