PMM monitoring with external postgresql data source

Description:

Unable to start PMM. i am using external postgres database as a datasource

Version:

2.40.1 postgres 14.9

getting the below error.

TASK [initialization : Create grafana database in postgres] ********************
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “unable to connect to database: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory\n\tIs the server running locally and accepting connections on that socket?\n”}

PLAY RECAP *********************************************************************
localhost : ok=12 changed=1 unreachable=0 failed=1 skipped=4 rescued=0 ignored=0
command given
docker run -itd --name pmm-server -e PERCONA_TEST_POSTGRES_ADDR=‘dbserverip’ -e PERCONA_TEST_POSTGRES_DBNAME=‘pmm-managed’ -e PERCONA_TEST_POSTGRES_USERNAME=‘admin’ -e PERCONA_TEST_POSTGRES_DBPASSWORD=‘dbloginpwd’ -e PERCONA_TEST_POSTGRES_SSL_MODE=‘disable’ -e PERCONA_TEST_PMM_DISABLE_BUILTIN_POSTGRES=true -e GF_DATABASE_URL=‘dbserverip’ -e GF_DATABASE_SSL_MODE=disable -p 80:80 -p 443:443 percona/pmm-server:2

unable to start it.