Fixing ansible python broken pipe for RHEL Centos 5


In this tutorial, How to fix run ansible “[Errno 32] Broken pipe\r\n”. I have enabled the EPEL repositories and installed the required dependencies for Python. How to Fix ansible python broken pipe.

ansible python broken pipe for RHEL

Ansible python broken pipe running error

"changed": false,
   "module_stderr": "",
   "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible-tmp-1546842879.5-134879756384147/\", line 133, in ?\r\n    exitcode = invoke_module(module, zipped_mod, ANSIBALLZ_PARAMS)\r\n  File \"/tmp/ansible-tmp-1546842879.5-134879756384147/\", line 38, in invoke_module\r\n    (stdout, stderr) = p.communicate(json_params)\r\n  File \"/usr/lib64/python2.4/\", line 1050, in communicate\r\n    stdout, stderr = self._communicate_with_poll(input)\r\n  File \"/usr/lib64/python2.4/\", line 1113, in _communicate_with_poll\r\n    input_offset += os.write(fd, chunk)\r\nOSError: [Errno 32] Broken pipe\r\n",
   "msg": "MODULE FAILURE",
   "rc": 1
       to retry, use: --limit @/nfs/playbooks/ansible-server/apache-server.retry

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
webserver01         : ok=0    changed=0    unreachable=0    failed=1

My Ansible uses Python 2.6 and a remote server is a Virtual Machine OS Centos 5 use Python 2.4

After you installed Python 2.6 on the remote server ( Centos 5). Then configure in the PATH for Python 2.6

For example, In my configuration in PATH as below

$ echo $PATH
$ which python

Configure symbolic link for Python 2.6 on the remote server Centos 5

$ ll /usr/bin/ | grep python
$ ln -sf  /usr/bin/python26 /usr/local/bin/python

With that:

python 2.6 is in “/usr/local/bin” *which is before “/usr/bin” in the PATH

python 2.4 is in “/usr/bin

And both are in the PATH

And you running the ansible-playbook command again.


If the “broken pipe” error persists after trying these steps, it may indicate a more complex network issue or a problem specific to your environment.

Through the article, you can use Fixing Ansible Python broken pipe for RHEL Centos 5. I hope this will be helpful for you. For more details, refer to the Ansible tutorial.


About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.