S3 storage
A standalone S3-compatible store gives backup_target: s3 instances and HA
clusters a shared pgBackRest repository. Three store types are supported, each
with its own example group.
Activate one store type
hosts.ini.example declares all three groups; only one child is active under
[s3] at a time:
Copy the matching example group vars:
group_vars/<type>_s3/main.yml.example
The example is commented per field; the commonly edited ones:
| Variable | Meaning |
|---|---|
pgcli_s3_type |
minio, silo or rustfs; must agree with the group name |
pgcli_s3_name |
Instance name (default backup) |
pgcli_s3_api_port, pgcli_s3_console_port |
S3 API and web console ports |
pgcli_s3_listen |
Bind address; TLS + network boundary guard the store |
pgcli_s3_tls |
Serve HTTPS; pgBackRest refuses plaintext HTTP |
pgcli_s3_autostart |
Start the store at boot; default true |
pgcli_s3_root_user |
Root/access user |
pgcli_s3_root_password |
Root secret; keep it in secrets.yaml for a grid |
pgcli_s3_drives |
One directory per drive; empty uses pgcli_s3_data_dir |
pgcli_s3_data_dir |
Single-node data directory |
pgcli_s3_endpoints |
Override the derived endpoint matrix |
pgcli_s3_tls_sans, pgcli_s3_cert_cn |
Extra SANs / certificate CN |
pgcli_s3_tls_cert, pgcli_s3_tls_key |
Bring-your-own certificate pair |
pgcli_s3_force |
Recreate the container |
pgcli_s3_buckets |
Buckets to create after install |
Layout is derived from hosts and drives
| Hosts | Drives | Mode | Flags per node |
|---|---|---|---|
| 1 | 0 | SNSD | --data-dir |
| 1 | N | SNMD | --drive × N |
| >1 | 0 | MNSD | --data-dir + one --endpoint per node |
| >1 | N | MNMD | --drive × N + one --endpoint per node per drive |
The endpoint matrix is generated in inventory order from each host’s
private_ip (falling back to ansible_host), so every node receives the same
list. A multi-node grid needs one shared root password and a shared
certificate; single-node stores generate their own CA. rustfs has no MNSD:
multi-node requires --drive on every node.
Deploy
Use the store as a backup target
In the database mode group (crosshost, ha_cluster, …), point at one store
node:
Then set backup_target: s3 on the instance (fixed at creation time). For HA
clusters, the pg_ha role consumes the same pgcli_backup_s3_* variables from
group_vars/ha_cluster, as shown on the HA clusters page. The
pg_instance role resolves <private_ip>:<port>, copies the store CA from
<base>/tls/<type>/<name>/ca.crt, and runs pg backup setup before creating
the instance.
For a store outside this inventory, omit pgcli_backup_s3_host, set
pgcli_backup_s3_endpoint: host:port (no scheme), and the role falls back to
pg backup fetch-ca.
Optional knobs: pgcli_backup_s3_region, _s3_path,
_no_verify_tls, _ca_file, _ca_sha256 (see the mode example files).
Removal
deploy-s3.yaml is deploy-only. Destroy a store on its node with the product
CLI: