Skip to content

Commit 6400538

Browse files
committed
test: tests_versions gather_facts; skip version 16 if not supported
tests_versions.yml requires facts, so `gather_facts: true` Skip installing version 16 on 9.3 and earlier, and 8.9 and earlier Signed-off-by: Rich Megginson <[email protected]>
1 parent 5d3b987 commit 6400538

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/tests_versions.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---
33
- name: Test installing and uninstalling all supported versions
44
hosts: all
5+
gather_facts: true
56
tasks:
67
- name: Skip test if distro does not support multiple versions
78
meta: end_host
@@ -19,7 +20,7 @@
1920

2021
- name: Install and cleanup the other supported versions
2122
include_tasks: tasks/install_and_check.yml
22-
loop: "{{ __versions }}"
23+
loop: "{{ __versions | difference(__unsuppported_versions) }}"
2324
when: item != __default_version # we already installed it
2425
vars:
2526
__test_check_version: true
@@ -29,3 +30,10 @@
2930
else __postgresql_versions_el9
3031
if ansible_facts['distribution_major_version'] == '9'
3132
else [] }}"
33+
__unsuppported_versions: "{{ ['16']
34+
if ansible_facts['distribution'] == 'RedHat' and
35+
((ansible_facts['distribution_major_version'] == '8' and
36+
ansible_facts['distribution_version'] is version('8.10', '<'))
37+
or (ansible_facts['distribution_major_version'] == '9' and
38+
ansible_facts['distribution_version'] is version('9.4', '<')))
39+
else [] }}"

0 commit comments

Comments
 (0)