Could not install awx behind a corporate proxy

Hello,

I’m facing a problem installing awx behind our corporate proxy.
I already added our proxy credentials for multiple tools inside the Dockerfile.j2 but the awx_web build task still fail.

Here’s what I already done in the container j2 file:

  • Add a /root/.bashrc file with proxy credentials

  • Add /etc/yum.conf with proxy credentials

  • set a global proxy conf for git

  • use command
    pip --proxy http://login:password@proxy:port

    install instead of just
    pip install

Here’s the kind of error I get:

Step 14/34 : 21 RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && 20 VENV_BASE=/var/lib/awx/venv make requirements_awx && 19 yum -y remove gcc postgresql-devel libxml2-devel libxslt-devel cyrus-sasl-devel openldap-devel xmlsec1-devel krb5-devel xmlsec1-openssl-devel libtool-ltdl-devel gcc- c++ python-devel && yum -y clean all && rm -rf /root/.cache\\n', u' 18 17 ---> Running in 432d28496ec3\\n', 16 u'\\x1b[91mfatal: Not a git repository (or any of the parent directories): .git\\n\\x1b[0m', 15 u'\\x1b[91mfatal: Not a git repository (or any of the parent directories): .git\\n\\x1b[0m', 14 u'\\x1b[91mfatal: Not a git repository (or any of the parent directories): .git\\n\\x1b[0m', 13 u'\\x1b[91mfatal: Not a git repository (or any of the parent directories): .git\\n\\x1b[0m', 12 u'\\x1b[91mfatal: Not a git repository (or any of the parent directories): .git\\n\\x1b[0m', 11 u'if [ \"/var/lib/awx/venv\" ]; then \\\\\\n\\tif [ ! -d \"/var/lib/awx/venv\" ]; 10 then \\\\\\n\\t\\tmkdir /var/lib/awx/venv; \\\\\\n\\tfi; 9 \\\\\\n\\tif [ ! -d \"/var/lib/awx/venv/ansible\" ]; 8 then \\\\\\n\\t\\tvirtualenv --system-site-packages /var/lib/awx/venv/ansible && 7 \\\\\\n\\t\\t/var/lib/awx/venv/ansible/bin/pip install --ignore-installed six packaging appdirs && 6 \\\\\\n\\t\\t/var/lib/awx/venv/ansible/bin/pip install --ignore-installed setuptools==36.0.1 && 5 \\\\\\n\\t\\t/var/lib/awx/venv/ansible/bin/pip install --ignore-installed pip==9.0.1; 4 \\\\\\n\\tfi; 3 \\\\\\nfi\\n', u'New python executable in /var/lib/awx/venv/ansible/bin/python2 2 \\nAlso creating executable in /var/lib/awx/venv/ansible/bin/python\\nInstalling setuptools, pip, wheel...', u'done. 1 \\n', u'Collecting six\\n', 23 u\"\\x1b[91m Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib 3.connection.VerifiedHTTPSConnection object at 0x1fd24d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/six/\\n\\x1b[0m\", u\"\\x1b[91m Re trying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.Verifie dHTTPSConnection object at 0x1fd2610>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/six/\\n\\x1b[0m\", u\"\\x1b[91m Retrying (Retry(total= 2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection obj ect at 0x1fd2750>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/six/\\n\\x1b[0m\", u\"\\x1b[91m Retrying (Retry(total=1, connect=None, rea d=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x1fd2890>, ' Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/six/\\n\\x1b[0m\", u\"\\x1b[91m Retrying (Retry(total=0, connect=None, read=None, redirect=Non e)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x1fd29d0>, 'Connection to pypi.p ython.org timed out. (connect timeout=15)')': /simple/six/\\n\\x1b[0m\", u'\\x1b[91m Could not find a version that satisfies the requirement six (from versions: )\\nNo matching distribution found for six\\n\\x1b[0m', u'\\x1b[91mmake: *** [virtualenv_ansible] Error 1\\n\\x1b[0m', u'Removing intermediate container 432d28496ec3\\n']"}

My thought is that it’s indeed related to the corporate proxy not set in the virtualenv.
Any clue ?

Thanks.

Hello,

i have installed an hour ago AWX behind a Proxy.

OS: RHEL7

yum install docker python-docker

Setup docker for proxy

/etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment=“HTTP_PROXY=http:…”

git clone …

Under …/installer/image_build/

  1. set ENV http_proxy/https_proxy in the template Dockerfile.j2 (for curl)
  2. create a yum.conf with the appropriate proxy settings under files/
  3. create a staging task similar to nginx.conf in the tasks/main.yml

ansible-playbook -i inventory install.yml

this may take a while …