Fix: Update to Ubuntu24.04, CS9, and Podman driver 79/73979/1
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 12 Dec 2025 13:07:23 +0000 (23:07 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Fri, 12 Dec 2025 13:15:56 +0000 (23:15 +1000)
- Switch from Docker to Podman driver for Molecule tests
- Add Ubuntu 24.04, CentOS Stream 9 support
- Remove EOL distributions (CentOS 7/8, Ubuntu 18.04/20.04)
- Add CentOS Stream 9 and RedHat 9 var files with native parallel package
- Fix Node.js repo installation for CentOS 7/8 only (not EL9)
- Update workflow to use requirements.txt and Python 3.11
- Add ansible.cfg to disable inject_facts_as_vars deprecation
- Set MOLECULE_PROJECT_DIRECTORY for dynamic role lookup
- Add gather_facts: true to converge.yml

CentOS 9 changes:
- Use native 'parallel' package instead of CERN RPM
- Restrict Nodesource Node.js repo to EL7/8 only
- Add separate vars files for CentOS Stream 9 and RedHat 9

Change-Id: I82a9520b86c357686ebd6b53686081ec04d2b7eb
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
.ansible.cfg [new file with mode: 0644]
.github/workflows/gerrit-verify.yaml
molecule/default/converge.yml
molecule/default/molecule.yml
requirements.txt [new file with mode: 0644]
tasks/main.yml
vars/CentOS Stream-9.yaml [new file with mode: 0644]
vars/RedHat-9.yaml [new file with mode: 0644]
vars/RedHat.yaml

diff --git a/.ansible.cfg b/.ansible.cfg
new file mode 100644 (file)
index 0000000..0aa5b5b
--- /dev/null
@@ -0,0 +1,3 @@
+[defaults]
+roles_path = ./
+inject_facts_as_vars = False
index 040838b..554ba56 100644 (file)
@@ -111,8 +111,9 @@ jobs:
     strategy:
       matrix:
         distro:
-          - ubuntu2004
+          - centos9
           - ubuntu2204
+          - ubuntu2404
       fail-fast: false
     steps:
       - name: Gerrit Checkout
@@ -123,17 +124,22 @@ jobs:
           gerrit-project: ${{ inputs.GERRIT_PROJECT }}
           gerrit-url: ${{ vars.GERRIT_URL }}
           delay: "0s"
-      - name: Install test dependencies.
+      - uses: actions/setup-python@v5
+        with:
+          python-version: "3.11"
+      - name: Install test dependencies
         run: |
           python -m pip install --upgrade pip
-          pip3 install ansible ansible-lint molecule-plugins[docker] docker
-      - name: Run Molecule tests.
-        run: molecule test
-        working-directory: ${{env.working-directory}}
+          pip3 install -r requirements.txt
+      - name: Run Molecule tests
+        run: |
+          cat molecule/default/molecule.yml
+          molecule test
         env:
           PY_COLORS: "1"
           ANSIBLE_FORCE_COLOR: "1"
           MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}
+          MOLECULE_PROJECT_DIRECTORY: ${{ github.workspace }}
 
   vote:
     if: ${{ always() }}
index 1e30adc..a8044fd 100644 (file)
@@ -1,5 +1,6 @@
 ---
 - name: Converge
   hosts: all
+  gather_facts: true
   roles:
     - role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
index 0353568..c519370 100644 (file)
@@ -2,22 +2,27 @@
 dependency:
   name: galaxy
 driver:
-  name: docker
+  name: podman
 platforms:
-  # - name: centos7
-  #   image: centos:7
-  # - name: centos8
-  #   image: quay.io/centos/centos:stream8
-  # - name: ubuntu1804
-  #   image: ubuntu:18.04
-  - name: ubuntu2004
-    image: ubuntu:20.04
+  - name: centos9
+    image: quay.io/centos/centos:stream9
   - name: ubuntu2204
     image: ubuntu:22.04
   - name: ubuntu2404
     image: ubuntu:24.04
 provisioner:
   name: ansible
-  # Fix for role path finding in latest molecule versions (~25.4.0)
-  env:
-    ANSIBLE_ROLES_PATH: ../../../
+  config_options:
+    defaults:
+      callbacks_enabled: ansible.posix.profile_tasks
+      inject_facts_as_vars: false
+  inventory:
+    host_vars:
+      centos9:
+        ansible_python_interpreter: /usr/bin/python3
+      ubuntu2204:
+        ansible_python_interpreter: /usr/bin/python3
+      ubuntu2404:
+        ansible_python_interpreter: /usr/bin/python3
+verifier:
+  name: ansible
diff --git a/requirements.txt b/requirements.txt
new file mode 100644 (file)
index 0000000..51293df
--- /dev/null
@@ -0,0 +1,4 @@
+ansible>=2.17,<2.19
+ansible-lint>=6.22,<25.0
+molecule>=6.0,<25.0
+molecule-plugins[podman]>=23.5,<25.0
index 27238ad..7ae0f1f 100644 (file)
@@ -94,7 +94,7 @@
               https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
             state: present
 
-        - name: Add Nodesource repositories for Node.js (CentOS 7+).
+        - name: Add Nodesource repositories for Node.js (CentOS 7/8 only).
           ansible.builtin.yum:
             name:
               "https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/\
               {{ ansible_architecture }}/nodesource-release-el\
               {{ ansible_distribution_major_version }}-1.noarch.rpm"
             state: present
-          when: ansible_distribution_major_version | int >= 7
+          when:
+            - ansible_distribution_major_version | int >= 7
+            - ansible_distribution_major_version | int <= 8
           register: node_repo
 
         - name: Update package cache if repo was added.
diff --git a/vars/CentOS Stream-9.yaml b/vars/CentOS Stream-9.yaml
new file mode 100644 (file)
index 0000000..c1dc2d9
--- /dev/null
@@ -0,0 +1,13 @@
+---
+# CentOS Stream 9 specific recommended tools (exclude legacy CentOS7 RPM URLs)
+lf_recommended_tools_packages_distro:
+  - bzip2
+  - fedora-packager
+  - findutils
+  - parallel
+  - nc
+  - perl-Digest-SHA
+  - perl-ExtUtils-MakeMaker
+  - perl-XML-XPath
+  - sqlite
+  - xz
diff --git a/vars/RedHat-9.yaml b/vars/RedHat-9.yaml
new file mode 100644 (file)
index 0000000..4acbb30
--- /dev/null
@@ -0,0 +1,12 @@
+---
+lf_recommended_tools_packages_distro:
+  - bzip2
+  - fedora-packager
+  - findutils
+  - parallel
+  - nc
+  - perl-Digest-SHA
+  - perl-ExtUtils-MakeMaker
+  - perl-XML-XPath
+  - sqlite
+  - xz
index 5a5c5cf..4acbb30 100644 (file)
@@ -3,7 +3,7 @@ lf_recommended_tools_packages_distro:
   - bzip2
   - fedora-packager
   - findutils
-  - https://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/parallel-20150522-1.el7.cern.noarch.rpm
+  - parallel
   - nc
   - perl-Digest-SHA
   - perl-ExtUtils-MakeMaker