msg:Python is not accessible at {{ ansible_python_interpreter }} on this host! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2 binary.
when:ansible_python_interpreter is defined and python_check.rc == 1
- name:Check if Python is in the default location
raw:test -e /usr/bin/python
ignore_errors:true
register:python_check
when:ansible_python_interpreter is undefined
- name:Fail if default Python is unavailable
fail:
msg:Python is not accessible at /usr/bin/python on this host! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2 binary.
when:ansible_python_interpreter is undefined and python_check.rc == 1