--- - name: Install EPEL repository yum: conf_file: '/etc/yum.conf' name: - epel-release state: present update_cache: yes when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and use_external_epel) - name: Install ancillary packages for CentOS 7 yum: conf_file: '/etc/yum.conf' name: - libselinux-python - python-pip when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7") - name: Install PostgreSQL {{ external_postgresql_version }} packages for CentOS 7 yum: conf_file: '/etc/yum.conf' name: - 'postgresql{{ external_postgresql_version | replace(".", "") }}' - 'postgresql{{ external_postgresql_version | replace(".", "") }}-server' state: present when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and not use_distribution_postgresql) - name: Install PostgreSQL 9.2 packages for CentOS 7 yum: conf_file: '/etc/yum.conf' name: - postgresql - postgresql-server state: present when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and use_distribution_postgresql) - name: Install ancillary packages for CentOS 8 dnf: conf_file: '/etc/dnf/dnf.conf' name: - python3-libselinux - python3-pip state: present when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8") - name: Disable the built-in PostgreSQL module command: dnf -qy module disable postgresql when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and not use_distribution_postgresql) - name: Install PostgreSQL {{ external_postgresql_version }} packages for CentOS 8 dnf: conf_file: '/etc/dnf/dnf.conf' name: - 'postgresql{{ external_postgresql_version | replace(".", "") }}' - 'postgresql{{ external_postgresql_version | replace(".", "") }}-server' state: present when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and not use_distribution_postgresql) - name: Install PostgreSQL 10 packages for CentOS 8 dnf: conf_file: '/etc/dnf/dnf.conf' name: - postgresql - postgresql-server state: present when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and use_distribution_postgresql) ...