Grzegorz Grasza e65f11baed Fix lint and molecule jobs after release of cryptography3.4
Molecule job fails with:

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1

The new pip is not supported on Python 2 / CentOS 7, so this change
also upgrades to CentOS 8 images.

This change also upgrades and fixes the ansible-lint job dependencies
and configuration.

[1] https://github.com/pyca/cryptography/issues/5753

Change-Id: I923020e7ec1f2ecbd7089096f22dd92fb36254a5
2021-03-17 14:42:12 +01:00

58 lines
1.9 KiB
YAML

---
- hosts: all
pre_tasks:
- name: Set project path fact
set_fact:
tripleo_ipa_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/x/tripleo-ipa'].src_dir }}"
- name: Ensure output dirs
file:
path: "{{ ansible_user_dir }}/zuul-output/logs"
state: directory
- name: Ensure pip is available
include_role:
name: ensure-pip
- name: Ensure a recent version of pip is installed in virtualenv
pip:
name: "pip>=19.1.1"
virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
- name: Setup test-python
pip:
requirements: "{{ tripleo_ipa_project_path }}/molecule-requirements.txt"
virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
- name: Make sure tox is installed in test-python virtualenv
pip:
name: tox
virtualenv: "{{ ansible_user_dir }}/test-python"
- name: Display test-python virtualenv package versions
shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate
pip freeze
# NOTE(cloudnull): This is being done because docker is not supported on RHEL-8
# and tests within this repo still require docker.
- name: Install gpg/container.io rpm
become: true
block:
- name: Import GPG key from docker.com
rpm_key:
state: present
key: https://download.docker.com/linux/centos/gpg
- name: Manually install containerd.io
package:
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
when:
- (ansible_distribution_major_version | int) >= 8
roles:
# docker is needed by multiple molecule scenarios
- role: ensure-docker