Fix tests and add Ubuntu 24.04 support 97/73497/1 master
authorEric Ball <eball@linuxfoundation.org>
Fri, 6 Jun 2025 22:07:38 +0000 (15:07 -0700)
committerEric Ball <eball@linuxfoundation.org>
Fri, 6 Jun 2025 22:15:46 +0000 (15:15 -0700)
These needed to be in a single commit due to interdependent changes.

Since the old "Debian.yml" list was only supporting Ubuntu 18.04 at
this point, and the identical "Ubuntu-2{0,2}" files would have also
needed to be extended to 24.04, we simply swap newer versions to
Debian.yml, and the legacy 18.04 has its own file.

Additionally, the code block that was adding 3.10 and 3.11 python
versions to the list was not functioning as intended (the loop still
only installed 3.8 and 3.9, while 3.10 and 3.11 are installed in
separate tasks), and therefore was removed.

Change-Id: I0889499d11ba3b9b4b26be3ba205e2464675bdf0
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
molecule/default/molecule.yml
tasks/main.yml
vars/Debian.yml
vars/Ubuntu-18.yml [moved from vars/Ubuntu-20.yml with 64% similarity]
vars/Ubuntu-22.yml [deleted file]

index e054301..85a28a5 100644 (file)
@@ -4,18 +4,23 @@ dependency:
 driver:
   name: docker
 platforms:
 driver:
   name: docker
 platforms:
-  - name: centos7
-    image: centos:7
-  - name: centos8
-    image: quay.io/centos/centos:stream8
-  - name: ubuntu1804
-    image: ubuntu:18.04
+  - 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: ubuntu2204
     image: ubuntu:22.04
   - name: ubuntu2004
     image: ubuntu:20.04
   - name: ubuntu2204
     image: ubuntu:22.04
+  - name: ubuntu2404
+    image: ubuntu:24.04
 provisioner:
   name: ansible
 provisioner:
   name: ansible
+  # Fix for role path finding in latest molecule versions (~25.4.0)
+  env:
+    ANSIBLE_ROLES_PATH: ../../../
 scenario:
   name: default
   test_sequence:
 scenario:
   name: default
   test_sequence:
@@ -28,5 +33,3 @@ scenario:
     - side_effect
     - verify
     - destroy
     - side_effect
     - verify
     - destroy
-verifier:
-  name: testinfra
index 6485451..99b1286 100644 (file)
     name: '{{ python_packages }}'
     state: present
 
     name: '{{ python_packages }}'
     state: present
 
-- name: Pre-set python versions required for pyenv global command
-  block:
-    - name: "Set Python version on Ubuntu >= 18.04 or CentOS 7"
-      ansible.builtin.set_fact:
-        pyenv_cmd: "{{ python_versions | join(' ') }}"
-      when:
-        - (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '18.04') or
-          (ansible_distribution == 'CentOS')
-
-    - name: "Set Python 3.10 on CentOS >= 8 or on Ubuntu >= 18/04"
-      ansible.builtin.set_fact:
-        pyenv_cmd: "{{ (python_versions | join(' ')) ~ ' ' ~ python310_version ~ ' ' ~ python311_version }}"
-      when:
-        - (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '18.04') or
-          (ansible_distribution == 'CentOS' and ansible_distribution_major_version >= '8')
+- name: Set Python version on Ubuntu >= 18.04 or CentOS 7
+  ansible.builtin.set_fact:
+    pyenv_cmd: "{{ python_versions | join(' ') }}"
+  when:
+    - (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '18.04') or
+      (ansible_distribution == 'CentOS')
 
 # Ref: https://github.com/pyenv/pyenv/issues/950
 # ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
 
 # Ref: https://github.com/pyenv/pyenv/issues/950
 # ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
index 5465ff6..cb4d2b5 100644 (file)
@@ -2,12 +2,8 @@
 python_packages_distro:
   - libffi-dev
   - libssl-dev
 python_packages_distro:
   - libffi-dev
   - libssl-dev
-  - python
-  - python-dev
-  - python-openssl
-  - python-pip
-  - python-setuptools
-  - python-virtualenv
+  - python-is-python3
+  - python3
   - python3
   - python3-dev
   - python3-openssl
   - python3
   - python3-dev
   - python3-openssl
similarity index 64%
rename from vars/Ubuntu-20.yml
rename to vars/Ubuntu-18.yml
index cb4d2b5..5465ff6 100644 (file)
@@ -2,8 +2,12 @@
 python_packages_distro:
   - libffi-dev
   - libssl-dev
 python_packages_distro:
   - libffi-dev
   - libssl-dev
-  - python-is-python3
-  - python3
+  - python
+  - python-dev
+  - python-openssl
+  - python-pip
+  - python-setuptools
+  - python-virtualenv
   - python3
   - python3-dev
   - python3-openssl
   - python3
   - python3-dev
   - python3-openssl
diff --git a/vars/Ubuntu-22.yml b/vars/Ubuntu-22.yml
deleted file mode 100644 (file)
index cb4d2b5..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
----
-python_packages_distro:
-  - libffi-dev
-  - libssl-dev
-  - python-is-python3
-  - python3
-  - python3
-  - python3-dev
-  - python3-openssl
-  - python3-pip
-  - python3-setuptools
-  - python3-virtualenv
-  - python3-venv