I am running AWX using Docker on a Cent OS 7 host.
I have a playbook that uses the script module to run a python script on the localhost to make HTTP GET requests using the AWX REST API.
But the awx_task container cannot make connections to complete the request and I get the following error on stdout.
If I exec into the container and run the playbook, I get this same error -
`
{
“changed”: false,
“_ansible_verbose_always”: true,
“_ansible_no_log”: false,
“response”: {
“stdout”: “HTTPConnectionPool(host=‘localhost’, port=80): Max retries exceeded with url: /api/v2/teams/ (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.HTTPConnection object at 0x18f56d0>: Failed to establish a new connection: [Errno 111] Connection refused’,))\n”,
“changed”: true,
“failed”: false,
“stderr”: “”,
“rc”: 0,
“stdout_lines”: [
“HTTPConnectionPool(host=‘localhost’, port=80): Max retries exceeded with url: /api/v2/teams/ (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.HTTPConnection object at 0x18f56d0>: Failed to establish a new connection: [Errno 111] Connection refused’,))”
]
}
}
`
These are my proxy settings in the AWX inventory file -
`
Proxy
http_proxy=http://proxy:3128
https_proxy=http://proxy:3128
no_proxy=mycorp.org
`
I can get out to the internet from the awx_task container. How can I fix this connection error?