Wrapper role to set up a two-node replicating Postgres cluster, and configure firewall.
Password for Pacemaker user hacluster.
Password for Postgres replication user.
The virtual IP address to assign to the master node.
Whether to add postgresql and high-availability services to Firewalld.
Default: true
Name of the cluster. Appears in pcs output.
Default: postgres
Default timeout (in seconds) for resource operations.
Default: 60
A dictionary with monitoring intervals (in seconds) for individual resources. Master and slave intervals must be different.
Defaults:
-
virtual_ip: 10 -
master: 3 -
slave: 7
A dictionary defining Postgres version, paths, and restore command.
Default:
-
version: 9.4 -
data_dir: /var/lib/pgsql/9.4/data -
bin_dir: /usr/pgsql-9.4/bin -
archive_dir: /var/lib/pgsql/9.4/archive -
service: postgresql-9.4 -
restore_command: cp /var/lib/pgsql/9.4/archive/%f %p
Whether to replace contents of /etc/motd with cluster management tips.
Default: true
Postgres user that replication runs as.
Default: replication
---
- hosts:
- alpha
- bravo
tasks:
- name: Set up high availability Postgres
include_role:
name: devgateway.postgres-ha
vars:
pgha_virtual_ip: 10.0.0.4
pgha_repl_passwd: hunter2
pgha_pcmk_passwd: qwerty
GPL v3+
Copyright 2018, Development Gateway