From 3c130795e36014c432dbe66edfa753ac934d710f Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 15 Feb 2022 09:12:26 -0300 Subject: [PATCH 1/3] build containers: Allow setting of Python version used. Currently the pipeline used to create test containers is using Python 3.6.15, and Ansible 2.12 requires, at least, Python 3.8. This change adds a new parameter to build container template, `python_version`, which is set by default to '3.x', meaning it will use the latest Python version available (for version 3) if the parameter is not explicitly set. --- tests/azure/templates/build_container.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/azure/templates/build_container.yml b/tests/azure/templates/build_container.yml index b474c964..7d5c1fb0 100644 --- a/tests/azure/templates/build_container.yml +++ b/tests/azure/templates/build_container.yml @@ -6,6 +6,9 @@ parameters: type: string - name: build_scenario_name type: string + - name: python_version + type: string + default: 3.x jobs: - job: BuildTestImage${{ parameters.job_name_suffix }} @@ -13,7 +16,7 @@ jobs: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.6' + versionSpec: '${{ parameters.python_version }}' - script: python -m pip install --upgrade pip setuptools wheel ansible displayName: Install tools From 5ab9ae21ad9528daecd7f08ca0a45586ac983db2 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 15 Feb 2022 10:11:00 -0300 Subject: [PATCH 2/3] molecule: Disable prerun for build containers. This disables the generation of the collection using the default galaxy.yml. The installation of the generated collection fails with invalid version A.B.C. The collection is not used when building containers and the generated collection is not using proper name and namespace in the collection files. --- molecule/centos-7-build/molecule.yml | 1 + molecule/centos-8-build/molecule.yml | 1 + molecule/centos-9-build/molecule.yml | 1 + molecule/fedora-latest-build/molecule.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/molecule/centos-7-build/molecule.yml b/molecule/centos-7-build/molecule.yml index a9a71d95..e88e1208 100644 --- a/molecule/centos-7-build/molecule.yml +++ b/molecule/centos-7-build/molecule.yml @@ -16,3 +16,4 @@ provisioner: name: ansible playbooks: prepare: ../resources/playbooks/prepare-build.yml +prerun: false diff --git a/molecule/centos-8-build/molecule.yml b/molecule/centos-8-build/molecule.yml index ec3ef20d..5698e8c0 100644 --- a/molecule/centos-8-build/molecule.yml +++ b/molecule/centos-8-build/molecule.yml @@ -16,3 +16,4 @@ provisioner: name: ansible playbooks: prepare: ../resources/playbooks/prepare-build.yml +prerun: false diff --git a/molecule/centos-9-build/molecule.yml b/molecule/centos-9-build/molecule.yml index c3f64c92..c333ec41 100644 --- a/molecule/centos-9-build/molecule.yml +++ b/molecule/centos-9-build/molecule.yml @@ -16,3 +16,4 @@ provisioner: name: ansible playbooks: prepare: ../resources/playbooks/prepare-build.yml +prerun: false diff --git a/molecule/fedora-latest-build/molecule.yml b/molecule/fedora-latest-build/molecule.yml index 4c6c2fcc..10635d3a 100644 --- a/molecule/fedora-latest-build/molecule.yml +++ b/molecule/fedora-latest-build/molecule.yml @@ -16,3 +16,4 @@ provisioner: name: ansible playbooks: prepare: ../resources/playbooks/prepare-build.yml +prerun: false From d111f0d92bc1738756c8dcae0725b7729679d6cc Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 15 Feb 2022 11:29:03 -0300 Subject: [PATCH 3/3] ci images: Fix creation of CentOS 9 stream test container. CentOS 9 Stream package pytho3-devel was not installable, and as it is not required for the testing container, it was removed from the Dockerfile used to create the image. --- molecule/centos-9-build/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/molecule/centos-9-build/Dockerfile b/molecule/centos-9-build/Dockerfile index 8d943454..2bb39a10 100644 --- a/molecule/centos-9-build/Dockerfile +++ b/molecule/centos-9-build/Dockerfile @@ -5,7 +5,6 @@ RUN rm -fv /var/cache/dnf/metadata_lock.pid; \ dnf makecache; \ dnf --assumeyes install \ /usr/bin/python3 \ - /usr/bin/python3-config \ /usr/bin/dnf-3 \ sudo \ bash \