# External Postgres configured with Patroni

**URL:** <https://forum.ansible.com/t/external-postgres-configured-with-patroni/30811>\
**Category:** AWX Project\
**Tags:** awx, kubernetes\
**Created:** [July 18, 2019, 4:23pm UTC](https://forum.ansible.com/t/external-postgres-configured-with-patroni/30811 "2019-07-18T16:23:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raja\_V](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Raja\_V](https://forum.ansible.com/u/Raja_V)\
**Post date:** [July 18, 2019, 4:23pm UTC](https://forum.ansible.com/t/external-postgres-configured-with-patroni/30811/1 "2019-07-18T16:23:44Z")

</div>

We have our AWX running in K8s and postgres is configured externally on a Patroni HA.  
Had enabled “pg\_hostname=postgresql” and its connectivity to primary server  
How can we give primary and secondary DB server in the connection string.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [July 18, 2019, 6:53pm UTC](https://forum.ansible.com/t/external-postgres-configured-with-patroni/30811/2 "2019-07-18T18:53:32Z")

</div>

Typically you will use something that will act as a proxy or load balancer between the two servers so that all you need to do is fail over the load balancer and not reconfigure AWX.

---

<div class="post-metadata">

**Author:** ![Raja\_V](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Raja\_V](https://forum.ansible.com/u/Raja_V)\
**Post date:** [July 19, 2019, 4:51am UTC](https://forum.ansible.com/t/external-postgres-configured-with-patroni/30811/3 "2019-07-19T04:51:31Z")

</div>

Do we have the option of connection string like ’ pg\_state=read-write ’ in AWX , so that we can give both primary and secondary server and the connection will go to db which is having read write option.
