This Ansible Galaxy Role sets up and configures the repositories from which packages will be retrieved for any Postgres or EnterpriseDB Postgresql Advanced Server installations.
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 Postgres nor EnterpriseDB Postgres Advanced Server for replication it only installs Postgres or EnterpriseDB Postgres Advanced Server across multiple nodes. Should there be a need to install and/or configure a Postgres or EnterpriseDB Postgres Advanced Server Cluster you can utilize the edb.postgres.install role.
The ansible playbook must be executed under an account that has full privileges.
The only dependencies required for this ansible galaxy role are:
- Ansible
When executing the role via ansible these are the required variables:
- OS Operating Systems supported are: CentOS7 and RHEL7
- PG_TYPE Database Engine supported are: PG and EPAS
- EDB_YUM_USERNAME If you have PG_TYPE = EPAS, then you need to include EDB_YUM_USERNAME
- EDB_YUM_PASSWORD If you have PG_TYPE = EPAS, then you need to include EDB_YUM_PASSWORD
The rest of the variables can be configured and are available in the:
The edb.postgres.repo role does not have any dependencies on any other roles.
Content of the hosts.yml file:
hosts:
main1:
node_type: main
public_ip: xxx.xxx.xxx.xxx
standby11:
node_type: standby
public_ip: xxx.xxx.xxx.xxx
standby12:
node_type: standby
public_ip: xxx.xxx.xxx.xxx
Below is an example of how to include the edb.postgres.repo role:
- hosts: localhost
name: Setup and Configure Repos for package retrievals
connection: local
become: true
gather_facts: no
vars_files:
- hosts.yml
pre_tasks:
# Define or re-define any variables previously assigned
- set_fact:
OS: OS
PG_TYPE: PG_TYPE
EDB_YUM_USERNAME: ""
EDB_YUM_PASSWORD: ""
with_dict: "{{ hosts }}"
tasks:
- name: Iterate through role with items from hosts file
include_role:
name: edb.postgres.repo
with_dict: "{{ hosts }}"
Defining and adding variables can be done in the set_fact of the pre-tasks.
All the variables are available at:
Distribution | 10 | 11 | 12 |
---|---|---|---|
CentOS 7 | ✅ | ✅ | ✅ |
Red Hat Linux 7 | ✅ | ✅ | ✅ |
Distribution | 10 | 11 | 12 |
---|---|---|---|
CentOS 7 | ✅ | ✅ | ✅ |
Red Hat Linux 7 | ✅ | ✅ | ✅ |
- ✅ - Tested and supported
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=PG"
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=PG"
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=PG"
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=EPAS"
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=EPAS"
ansible-playbook playbook.yml -u centos -- private-key <key.pem> --extra-vars="OS=CentOS7 PG_TYPE=EPAS"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=PG"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=PG"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=PG"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=EPAS"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=EPAS"
ansible-playbook playbook.yml -u ec2-user -- private-key <key.pem> --extra-vars="OS=RHEL7 PG_TYPE=EPAS"
Not Supported.
Not Supported.
Not Supported.
Not Supported.
BSD
Author:
- Doug Ortiz
- Vibhor Kumar (Reviewer)
- EDB Postgres
- DevOps
- [email protected] www.enterprisedb.com