Commit 8364ae22 authored by viscapi's avatar viscapi
Browse files

Installation of stock or external PostgreSQL on CentOS 7 and 8

parent 1de7c1d6
---
- name: Print PostgreSQL version
debug:
msg: '{{ postgresql_version | replace(".", "") }}'
- name: Install PostgreSQL {{ postgresql_version }} packages for CentOS 7
- name: Install ancillary packages for CentOS 7
yum:
conf_file: '/etc/yum.conf'
name:
name:
- libselinux-python
- python-pip
- 'postgresql{{ postgresql_version | replace(".", "") }}'
- 'postgresql{{ postgresql_version | replace(".", "") }}-server'
state: present
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
- name: Install PostgreSQL 10.6 packages for CentOS 8
- 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: 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")
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and use_distribution_postgresql)
...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment