Xubuntu [SOLVED]: /usr/bin/python: not found – Ansible on Xenial

Xubuntu [SOLVED]: /usr/bin/python: not found – Ansible on Xenial

Home Forums Xubuntu Xubuntu [SOLVED]: /usr/bin/python: not found – Ansible on Xenial

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #36877



    With Vagrant I created a Ubuntu Xenial 16.04.3 LTS. When I launch my ansible-playbook:

    "module_stdout": "/bin/sh: 1: /usr/bin/python: not foundrn"

    I installed python2.7 and

    sudo ln -s /usr/bin/python2.7 /usr/bin/python

    Everything seemed to work properly but is there a better way to resolve the problem? I feel like it’s a dirty hotfix…



    Accepted AnswerAnswer

    From the Ansible FAQ:

    By default, Ansible assumes it can find a /usr/bin/python on your remote system that is a 2.X version of Python, specifically 2.6 or higher.

    Setting the inventory variable ansible_python_interpreter on any host will allow Ansible to auto-replace the interpreter used when executing python modules. Thus, you can point to any python you want on the system if /usr/bin/python on your system does not point to a Python 2.X interpreter.

    Source: https://stackoverflow.com/questions/48036600/usr-bin-python-not-found-ansible-on-xenial
    Author: Charles Duffy
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.