module stderr bin sh 1 usr bin python not found n MODULE FAILURE nSee stdout stderr for the exact error

0 votes

Hi Guys,

I am trying to run Ansible Playbook. But it is showing the below error.

FAILED! => {"changed": false, 
"module_stderr": "/bin/sh: 1: /usr/bin/python: not found\n", 
"module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 
"rc": 127
Sep 17, 2020 in Ansible by akhtar
• 38,210 points

1 answer to this question.

0 votes


This is because your system does not include /usr/bin/python (Python 2) by default. Your playbook is trying to use Python 2 (/usr/bin/python) by default. So either you can install or if you have python3 then you can use the below trick in your playbook.

  hosts: "*"
    ansible_python_interpreter: /usr/bin/python3
    - debug: var=ansible_host
answered Sep 17, 2020 by MD
• 95,300 points

Related Questions In Ansible

0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer