ci-workers: Fail if Python is not version 2.7
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.
This commit is contained in:
parent
30cc2b846e
commit
2e839df328
|
@ -19,7 +19,7 @@
|
||||||
prompt: "Buildbot worker password (provided by ZECC)"
|
prompt: "Buildbot worker password (provided by ZECC)"
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Install Python 2 for Ansible and Buildbot
|
- name: Install Python 2.7 for Ansible and Buildbot
|
||||||
raw: test -e /usr/bin/python || test -e /usr/bin/python2 || test -e /usr/bin/python2.7 || test -e /usr/local/bin/python2.7 || (test -e /usr/bin/apt && apt -qqy update && apt install -qqy python) || (test -e /usr/bin/dnf && dnf install -qqy python2) || (test -e /usr/sbin/pkg && pkg install -qqy python2)
|
raw: test -e /usr/bin/python || test -e /usr/bin/python2 || test -e /usr/bin/python2.7 || test -e /usr/local/bin/python2.7 || (test -e /usr/bin/apt && apt -qqy update && apt install -qqy python) || (test -e /usr/bin/dnf && dnf install -qqy python2) || (test -e /usr/sbin/pkg && pkg install -qqy python2)
|
||||||
register: output
|
register: output
|
||||||
changed_when:
|
changed_when:
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
- name: Fail if configured Python is unavailable
|
- name: Fail if configured Python is unavailable
|
||||||
fail:
|
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.
|
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
|
when: ansible_python_interpreter is defined and python_check.rc == 1
|
||||||
|
|
||||||
- name: Check if Python is in the default location
|
- name: Check if Python is in the default location
|
||||||
|
@ -45,12 +45,17 @@
|
||||||
|
|
||||||
- name: Fail if default Python is unavailable
|
- name: Fail if default Python is unavailable
|
||||||
fail:
|
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
|
when: ansible_python_interpreter is undefined and python_check.rc == 1
|
||||||
|
|
||||||
- name: Gathering Facts
|
- name: Gathering Facts
|
||||||
setup:
|
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
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Get dependencies for distribution
|
- name: Get dependencies for distribution
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
|
|
Loading…
Reference in New Issue