How to Fix “Shared connection to x.x.xx closed” Ansible Error

In this short article, we will explain how to solve the: “ module_stderr “: “Shared connection to x.x.x.x closed.\r\n”, “module_stdout”: “/bin/sh: /usr/bin/python: No such file or directory\r\n”, while running Ansible commands.

The following screenshot shows the Ansible module error. We encountered this error while running an Ansible command to execute commands on two newly deployed CentOS 8 servers.

Originally Published at