- name:Install Python 2 for Ansible and Buildbot [tcsh]
raw:tcsh -c "{{ python_raw }}"
- name:Check if Python is in the configured location
raw:test -e {{ ansible_python_interpreter }}
ignore_errors:true
register:output
changed_when:
- output.stdout != ""
- output.stdout != "\r\n"
register:python_check
when:ansible_python_interpreter is defined
- name:Fail if configured Python is unavailable
fail:
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