This Ansible Galaxy Role Installs EFM versions: 3.10 and 4.0 on instances previously configured.
Note: The role only installs EPAS: 10, 11, 12, 13, 14 or 15 along with EFM: 3.10 or 4.x across multiple nodes.
Not all Distribution or versions are supported on all the operating systems available.
For more details refer to the: Database engines supported section.
Note: The role does not configure EDB Postgres Advanced Server or PostgreSQL for replication it only installs EDB Postgres Failover Manager (EFM) across multiple nodes and configure database nodes for EFM monitornig and HA management.
The ansible playbook must be executed under an account that has full privileges.
The requirements for this ansible galaxy role are:
- Ansible >= 2.9
community.general
edb_devops.edb_postgres
->setup_repo
- for installing the EPAS/PG repositoryedb_devops.edb_postgres
->install_dbserver
- for installing the EPAS/PG binariesedb_devops.edb_postgres
->init_dbserver
- for initializing the EPAS/PG data directory and configuring a primary node.edb_devops.edb_postgres
->setup_replication
- for creating the standby.
When executing the role via ansible there are three required variables:
- os
Operating Systems supported are: CentOS7, RHEL7, CentOS8, RHEL8, Debian10, Ubuntu20 and AlmaLinux8
- pg_version
Postgres Versions supported are: 10, 11, 12, 13, 14 and 15
- pg_type
Database Engine supported are: PG and EPAS
These and other variables can be assigned in the pre_tasks
definition of the
section: How to include the setup_efm
role in your Playbook
The rest of the variables can be configured and are available in the:
- roles/setup_efm/defaults/main.yml
- roles/setup_efm/vars/EPAS_Debian.yml
- roles/setup_efm/vars/EPAS_RedHat.yml
- roles/setup_efm/vars/PG_Debian.yml
- roles/setup_efm/vars/PG_RedHat.yml
The setup_efm
role does not have any dependencies on any other roles.
Content of the inventory.yml
file:
all:
children:
primary:
hosts:
primary1:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
standby:
hosts:
standby1:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
upstream_node_private_ip: xxx.xxx.xxx.xxx
replication_type: synchronous
standby2:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
upstream_node_private_ip: xxx.xxx.xxx.xxx
replication_type: asynchronous
Below is an example of how to include the setup_efm
role:
---
- hosts: primary,standby
name: Install EFM on Instances
become: true
gather_facts: yes
any_errors_fatal: true
collections:
- edb_devops.edb_postgres
pre_tasks:
- name: Initialize the user defined variables
set_fact:
pg_type: "PG"
pg_version: 14
efm_version: 4.0
efm_init_parameters:
- name: script.notification
value: "/usr/edb/efm-4.0/bin/notification.sh"
roles:
- role: setup_repo
when: "'setup_repo' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: install_dbserver
when: "'install_dbserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: init_dbserver
when: "'init_dbserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_replication
when: "'setup_replication' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_efm
when: "'setup_efm' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
Defining and adding variables is done in the set_fact
of the pre_tasks
.
All the variables are available at:
- roles/setup_efm/defaults/main.yml
- roles/setup_efm/vars/EPAS_Debian.yml
- roles/setup_efm/vars/EPAS_RedHat.yml
- roles/setup_efm/vars/PG_Debian.yml
- roles/setup_efm/vars/PG_RedHat.yml
Distribution | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|
CentOS 7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Red Hat Linux 7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
RockyLinux 8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Red Hat Linux 8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
AlmaLinux8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Ubuntu 20.04 LTS (Focal) - x86_64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Debian 9 (Stretch) - x86_64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Debian 10 (Buster) - x86_64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Distribution | 10 | 11 | 12 | 13 | 14 | 15 |
---|---|---|---|---|---|---|
CentOS 7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Red Hat Linux 7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
RockyLinux 8 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
Red Hat Linux 8 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
AlmaLinux8 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
Ubuntu 20.04 LTS (Focal) - x86_64 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
Debian 9 (Stretch) - x86_64 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
Debian 10 (Buster) - x86_64 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
- ✅ - Tested and supported
- ❌ - Not supported
# To deploy community Postgres version 14 on CentOS7 hosts with the user centos
# EFM version 4.4
$ ansible-playbook playbook.yml \
-u centos \
-i inventory.yml \
--private-key <key.pem> \
--extra-vars="pg_version=14 pg_type=PG efm_version=4.4"
# To deploy EPAS version 12 on RHEL8 hosts with the user ec2-user EFM version
# 3.10
$ ansible-playbook playbook.yml \
-u ec2-user \
-i inventory.yml \
--private-key <key.pem> \
--extra-vars="pg_version=12 pg_type=EPAS efm_version=3.10"
BSD
Author:
- Doug Ortiz
- Vibhor Kumar (Co-Author)
- EDB Postgres
- DevOps
- [email protected] www.enterprisedb.com