AWX fails to connect to my external postgres server

1,581 views
Skip to first unread message

mamado...@gmail.com

unread,
Mar 15, 2018, 10:34:04 AM3/15/18
to AWX Project
Hello there,

If anyone can help


here some logs after issuing ansible-playbook -i inventory install.yml

[root@PA-PGL-VMNO-0 installer]# docker logs -f awx_task
Using /etc/ansible/ansible.cfg as config file
127.0.0.1 | SUCCESS => {
    "changed": false,
    "elapsed": 0,
    "path": null,
    "port": 5432,
    "search_regex": null,
    "state": "started"
}
Using /etc/ansible/ansible.cfg as config file
127.0.0.1 | SUCCESS => {
    "changed": false,
    "elapsed": 0,
    "path": null,
    "port": 11211,
    "search_regex": null,
    "state": "started"
}
Using /etc/ansible/ansible.cfg as config file
127.0.0.1 | SUCCESS => {
    "changed": false,
    "elapsed": 0,
    "path": null,
    "port": 5672,
    "search_regex": null,
    "state": "started"
}
Using /etc/ansible/ansible.cfg as config file
[DEPRECATION WARNING]: The sudo command line option has been deprecated in
favor of the "become" command line arguments. This feature will be removed in
version 2.6. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: FATAL:  no pg_hba.conf entry for host "10.100.10.139", user "awx", database "postgres", SSL off
127.0.0.1 | FAILED! => {
    "changed": false,
    "msg": "unable to connect to database: FATAL:  no pg_hba.conf entry for host \"10.100.10.139\", user \"awx\", database \"postgres\", SSL off\n"
}
^C

In my inventory file:

pg_hostname=10.100.10.180
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432

As a reminder, in my awx server (redhat VM),  the docker containers awx_web, awx_task, rabbitmq and memcached ran as well, but it can't connect to my external postgresql server (another redhat VM) which I installed without launched any docker.

I pointed the address of my awx server in pg_hba.conf file in postgres machine (/pgqdata/pgserver01/data/pg_hba.conf),

Below the pg_hba.conf in postgrsql server :

local              all     postgres           trust
hostnossl       all     all     0.0.0.0/0             trust
# IPv4 local connections:
host    all         all         0.0.0.0/0             md5
host    awx    postgres        10.100.10.139/32        md5

Thanks in advance,

Matthew Jones

unread,
Mar 15, 2018, 10:06:50 PM3/15/18
to mamado...@gmail.com, AWX Project
Check the logs on the postgres side, make sure there isn't a firewall blocking the connection. This issue doesn't appear to be strictly related to AWX itself so it just comes down to figuring out postgres.

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/8f4ba580-92dc-43d6-b260-1c23abd96c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Jones
Principal Software Engineer
Ansible Tower

mamado...@gmail.com

unread,
Mar 16, 2018, 12:31:04 PM3/16/18
to AWX Project
Yes, it was a postgres issue. 

I upgraded the postgres (9.4 to 9.6) and now everything works as well.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/8f4ba580-92dc-43d6-b260-1c23abd96c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages