Role Reference
This page describes each role in the pgEdge Ansible Collection and provides links to detailed documentation for each role.
Role Execution Order
Roles must be applied in a specific order to satisfy dependencies. The following list shows the correct execution sequence:
init_server- Prepares all servers in the cluster.install_repos- Installs the pgEdge and PGDG package repositories.install_pgedge- Installs pgEdge packages on pgEdge nodes.setup_postgres- Initializes PostgreSQL on pgEdge nodes.install_etcd- Installs etcd on pgEdge nodes (HA only).install_patroni- Installs Patroni on pgEdge nodes (HA only).install_backrest- Installs PgBackRest on backup-capable nodes.install_pgbouncer- Installs pgBouncer on pgEdge nodes (pooled clusters only).setup_etcd- Configures and starts etcd (HA only).setup_patroni- Configures Patroni and starts the HA cluster (HA only).setup_pgbouncer- Configures and starts pgBouncer on pooled nodes.setup_haproxy- Configures HAProxy on haproxy nodes (HA only).setup_pgedge- Creates Spock nodes and establishes subscriptions.setup_backrest- Configures PgBackRest and runs the first backup.
The two pgBouncer roles are the only optional pair in the sequence. Pooling is
opt-in per cluster, so both are gated on pgbouncer_enabled; a cluster that
does not pool omits them and is otherwise unchanged. See
Pooling Configuration.
Role Categories
The roles in this collection fall into four categories.
Configuration Foundation
| Role | Description |
|---|---|
role_config |
Provides shared variables and computed values to all other roles. You do not call this role directly. |
Server Preparation
| Role | Description |
|---|---|
init_server |
Initializes servers with required packages and system configuration. |
install_repos |
Configures the pgEdge and PGDG package repositories. |
Software Installation
| Role | Description |
|---|---|
install_pgedge |
Installs Postgres with pgEdge extensions. |
install_etcd |
Installs etcd for HA cluster coordination. |
install_patroni |
Installs Patroni for HA management. |
install_backrest |
Installs PgBackRest for backup and restore operations. |
install_pgbouncer |
Installs pgBouncer for connection pooling on pooled nodes. |
Service Configuration
| Role | Description |
|---|---|
setup_postgres |
Initializes and configures Postgres instances. |
setup_etcd |
Configures and starts etcd clusters. |
setup_patroni |
Configures and starts Patroni. |
setup_pgbouncer |
Configures and starts pgBouncer on pooled nodes. |
setup_haproxy |
Installs and configures HAProxy. |
setup_pgedge |
Establishes Spock replication between nodes. |
setup_backrest |
Configures PgBackRest and schedules backups. |