[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: I53e666d59d0cce26e38c6f66a39eb204bda502d3
This commit is contained in:
Radosław Piliszek 2021-06-26 19:11:07 +00:00
parent 4a5f57210a
commit 0d8f65eac8
2 changed files with 15 additions and 30 deletions

View File

@ -221,14 +221,12 @@
vars:
# Test latest ansible version on Ubuntu, minimum supported on others.
ansible_version_constraint: "{{ '==2.9.*,!=2.9.8,!=2.9.12' if base_distro == 'ubuntu' else '==2.8.*,!=2.8.14' }}"
pip:
name:
- "{{ kolla_ansible_src_dir }}"
- "ansible{{ ansible_version_constraint }}"
- "ara<1.0.0"
# TODO(mgoddard): Always use pip3 when previous_release is ussuri.
executable: "pip{{ playbook_python_version }}"
extra_args: "-c {{ upper_constraints_file }} --user"
command: >-
python{{ playbook_python_version }} -m pip install --user
-c {{ upper_constraints_file }}
{{ kolla_ansible_src_dir }}
ansible{{ ansible_version_constraint }}
ara<1.0.0
# TODO(mgoddard): Always use python3 when previous_release is ussuri.
- name: get ARA callback plugin path
@ -540,25 +538,15 @@
# TODO(mgoddard): Remove this block when previous_release is ussuri.
- block:
- name: remove ansible and ARA for python 2
pip:
name:
- ansible
- ara
executable: pip2
state: absent
when: playbook_python_version == '2'
- name: install ansible and ARA for python 3
vars:
# Test latest ansible version on Ubuntu, minimum supported on others.
ansible_version_constraint: "{{ '==2.9.*,!=2.9.8' if base_distro == 'ubuntu' else '==2.8.*' }}"
pip:
name:
- "ansible{{ ansible_version_constraint }}"
- "ara<1.0.0"
executable: pip3
extra_args: "-c {{ upper_constraints_file }} --user"
command: >-
python3 -m pip install --user
-c {{ upper_constraints_file }}
ansible{{ ansible_version_constraint }}
ara<1.0.0
- name: get ARA callback plugin path
command: "python3 -m ara.setup.callback_plugins"
@ -572,10 +560,10 @@
become: true
- name: upgrade kolla-ansible
pip:
name: "{{ kolla_ansible_src_dir }}"
executable: pip3
extra_args: "-c {{ upper_constraints_file }} --user"
command: >-
python3 -m pip install --user
-c {{ upper_constraints_file }}
{{ kolla_ansible_src_dir }}
# Update passwords.yml to include any new passwords added in this
# release.

View File

@ -38,9 +38,6 @@
neutron_external_network_prefix_length: "24"
neutron_external_interface_name: vxlan1
tls_enabled: false
# NOTE(yoctozepto): Ansible on Debian defaults to /usr/bin/python which is
# python2. Let's use python3 instead as expected in 2020 and beyond.
ansible_python_interpreter: python3
configure_swap_size: 0
roles:
- zuul: zuul/zuul-jobs