Interview Prep/Ansible/Privilege Escalation and Python Interpreter Issues

`unable to resolve ... ansible_python_interpreter` after switching from Python 2 to 3 on Ubuntu 20.04 hosts: `/usr/bin/python: No such file or directory`

BeginnerTroubleshootingPrivilege Escalation and Python Interpreter Issues
Answer

Likely causes → An old inventory still pins ansible_python_interpreter=/usr/bin/python.

Diagnose → grep -rn ansible_python_interpreter inventories group_vars host_vars.

Fix → Remove the pin or change it to /usr/bin/python3.

Prevent → Prefer auto discovery.

All Ansible questions Roadmap: Ansible

More on Privilege Escalation and Python Interpreter Issues