Skip to content

Commit

Permalink
test: tests_versions gather_facts; skip version 16 if not supported
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
richm committed Jan 31, 2024
1 parent 5d3b987 commit 6400538
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/tests_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
---
- name: Test installing and uninstalling all supported versions
hosts: all
gather_facts: true
tasks:
- name: Skip test if distro does not support multiple versions
meta: end_host
Expand All @@ -19,7 +20,7 @@

- name: Install and cleanup the other supported versions
include_tasks: tasks/install_and_check.yml
loop: "{{ __versions }}"
loop: "{{ __versions | difference(__unsuppported_versions) }}"
when: item != __default_version # we already installed it
vars:
__test_check_version: true
Expand All @@ -29,3 +30,10 @@
else __postgresql_versions_el9
if ansible_facts['distribution_major_version'] == '9'
else [] }}"
__unsuppported_versions: "{{ ['16']
if ansible_facts['distribution'] == 'RedHat' and
((ansible_facts['distribution_major_version'] == '8' and
ansible_facts['distribution_version'] is version('8.10', '<'))
or (ansible_facts['distribution_major_version'] == '9' and
ansible_facts['distribution_version'] is version('9.4', '<')))
else [] }}"

0 comments on commit 6400538

Please sign in to comment.