From ee5e4f8a83d8f816bc3dd0ea239b5eed455dac10 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 21 Oct 2024 08:39:13 +0200 Subject: [PATCH] tests: simplify distro check in tests_environments.yml Simplify a distro check in tests_environments.yml to ease potentially adding more EL distros: - because of the short-circuiting of expressions, all the "or" conditions are run currently only on "CentOS" and "RedHat" - since CentOS Stream is the only "unversioned" EL distro, move its condition as the first after the distro check - drop the name check, leaving only the version check, in any other case (i.e. currently on "RedHat") This makes is possible to support more EL distros in this check, and in case they are versioned all it is needed is to tweak the first condition (i.e. the check for "ansible_distribution not in ..."). There is no behaviour change. Signed-off-by: Pino Toscano --- tests/tests_environments.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/tests_environments.yml b/tests/tests_environments.yml index 713c4a6..0b9c13a 100644 --- a/tests/tests_environments.yml +++ b/tests/tests_environments.yml @@ -85,10 +85,9 @@ when: - >- ansible_distribution not in ["CentOS", "RedHat"] - or (ansible_distribution == "RedHat" - and ansible_distribution_version is version("8.6", ">=")) or (ansible_distribution == "CentOS" and ansible_distribution_major_version | int >= 8) + or (ansible_distribution_version is version("8.6", ">=")) block: - name: Get enabled environments include_tasks: tasks/list_environments.yml