From 715e2b4c499d6e823764fc189bc189f92ea0e856 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 8 Aug 2024 19:03:24 +0200 Subject: [PATCH] Use dnf on EL 8+. --- tasks/postgresql_org_repo.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/postgresql_org_repo.yml b/tasks/postgresql_org_repo.yml index 17bdd65..50fcbb1 100644 --- a/tasks/postgresql_org_repo.yml +++ b/tasks/postgresql_org_repo.yml @@ -40,7 +40,16 @@ - ansible_distribution_file_variety == "RedHat" tags: ['postgresql', 'postgresql_repo', 'postgres_client'] block: - - name: postgresql_org_repo | Install the pgsql pgdg repository + - name: postgresql_org_repo | Install the pgsql pgdg repository on EL 7 ansible.builtin.yum: name: "{{ psql_el_pgdg_repo_url }}" state: present + disable_gpg_check: true + when: ansible_distribution_major_version is version_compare('8', '<') + + - name: postgresql_org_repo | Install the pgsql pgdg repository on EL 8+ + ansible.builtin.dnf: + name: "{{ psql_el_pgdg_repo_url }}" + state: present + disable_gpg_check: true + when: ansible_distribution_major_version is version_compare('8', '>=')