Ansible works with Python 2.6 and 2.7, but Buildbot requires 2.7. Both have
at least preliminary Python 3 support, but until our RPC tests are migrated to
Python 3, we need to use Python 2 for testing, and so this requirement stands.
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.
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.7 binary."
when:ansible_python_interpreter is defined and python_check.rc == 1
- name:Check if Python is in the default location
@ -45,12 +45,17 @@
- 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.
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.7 binary.
when:ansible_python_interpreter is undefined and python_check.rc == 1
- name:Gathering Facts
setup:
- name:Fail if Python is the wrong version
fail:
msg:"The Python binary at {{ ansible_python.executable }} is version {{ ansible_python_version }}! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2.7 binary."
when:ansible_python.version.major != 2 or ansible_python.version.minor != 7