From ce988a2eb6e15fe58472739557e25d7e46a14cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Mon, 28 Jun 2021 06:57:10 +0000 Subject: [PATCH] [CI] Do not set ansible_python_interpreter for Zuul Zuul 4.6.0 does not allow to set ansible_python_interpreter. [1] Instead, with the current Zuul and Ansible, this should be automatically set to the proper python. This patch is required to restore the jobs which are ignored otherwise. [2] [3] Additionally, this change avoids the use of Ansible's pip module because it tries to use setuptools from the ansible_python_interpreter first even if another executable is set. [1] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023291.html [2] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023326.html [3] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023321.html Change-Id: Ib74eecd46617af51e23a3ccad664767b1bf6e04f --- .zuul.d/base.yaml | 1 - tests/playbooks/pre.yml | 9 ++++----- tests/playbooks/publish.yml | 9 +++------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.zuul.d/base.yaml b/.zuul.d/base.yaml index de3c0b1283..6018c15873 100644 --- a/.zuul.d/base.yaml +++ b/.zuul.d/base.yaml @@ -110,7 +110,6 @@ - ^tox\.ini$ vars: publisher: false - ansible_python_interpreter: python3 extra-vars: kolla_logs_dir: "{{ zuul_output_dir }}/logs/kolla" kolla_build_logs_dir: "{{ kolla_logs_dir }}/build" diff --git a/tests/playbooks/pre.yml b/tests/playbooks/pre.yml index 2c289ef0b4..30eb8c9fc7 100644 --- a/tests/playbooks/pre.yml +++ b/tests/playbooks/pre.yml @@ -38,12 +38,11 @@ when: ansible_os_family == "Debian" + - name: Create virtualenv + command: python3 -m virtualenv {{ virtualenv_path }} --python python3 + - name: Install kolla - pip: - name: . - chdir: "{{ zuul.project.src_dir }}" - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: python3 + command: "{{ virtualenv_path }}/bin/python -m pip install {{ zuul.project.src_dir }}" - name: Configure Docker repo for Debian/Ubuntu block: diff --git a/tests/playbooks/publish.yml b/tests/playbooks/publish.yml index 6c688b6641..33a497b094 100644 --- a/tests/playbooks/publish.yml +++ b/tests/playbooks/publish.yml @@ -1,12 +1,9 @@ --- - hosts: all + vars: + # NOTE(yoctozepto): We need Docker SDK, the best source is Kolla venv. + ansible_python_interpreter: "{{ virtualenv_path }}/bin/python" tasks: - - name: Ensure docker python SDK is installed - become: true - pip: - name: "docker" - state: present - - name: List all containers docker_host_info: images: yes