HA PostgreSQL installation using patroni and pgbouncer
Yes, you can use Consul templates for this. https://github.com/hashicorp/consul-template This will notify pgbouncer that Patroni has elected a new master.
Cheers,
Dave