vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on "Patroni" and DCS "etcd" or "consul"). Automating with Ansible.
MIT License
1.27k stars 340 forks source link

Add the ability to set Patroni tags (including custom tags) at the host level #611

Closed vitabaks closed 1 month ago

vitabaks commented 1 month ago

Related issue: https://github.com/vitabaks/postgresql_cluster/issues/586

Added the ability to add tags for Patroni (including custom tags) at the host level in the inventory file.

Example:

root@pgnode01:/# patronictl -c /etc/patroni/patroni.yml list
+ Cluster: postgres-cluster (7351028658196582445) --+-----------+-----------------+
| Member   | Host        | Role    | State     | TL | Lag in MB | Tags            |
+----------+-------------+---------+-----------+----+-----------+-----------------+
| pgnode01 | 10.172.0.20 | Leader  | running   |  2 |           | datacenter: dc1 |
| pgnode02 | 10.172.0.21 | Replica | streaming |  2 |         0 | datacenter: dc1 |
| pgnode03 | 10.172.0.22 | Replica | streaming |  2 |         0 | datacenter: dc2 |
+----------+-------------+---------+-----------+----+-----------+-----------------+