When using postgresql_port with custom value ( != 5432), tasks relying on psql fails with message:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
It seem that psql client don't get the correct socket name based on the actual configured port, which is 5612 in my case:
When using
postgresql_port
with custom value ( != 5432), tasks relying on psql fails with message:It seem that psql client don't get the correct socket name based on the actual configured port, which is 5612 in my case:
I think a simple fix would be to add PGPORT env var to each task relaying on psql client:
for example:
Temporary fix, add environment PGPORT to the playbook step calling the postgresl role:
Envs: