Have an ansible-requirements.txt file to install necessary python modules during build time. The proxy settings in the container.yml are not being passed as build-arguments to the downstream container build. This is necessary because we need to set http_proxy, no_proxy, and https_proxy in order to do these external builds. The builds are failing because it is unable to reach the external network because the necessary environment variables are not being passed back to the downstream build.
STEPS TO REPRODUCE
ansible-container build
EXPECTED RESULTS
Container builds
ACTUAL RESULTS
Without debugging
BuildError: The command '/bin/sh -c pip install --no-cache-dir -r /_ansible/build/ansible-requirements.txt && ansible-galaxy install -p /etc/ansible/roles -r /_ansible/build/requirements.yml && cp /_ansible/build/ansible.cfg /etc/ansible/ansible.cfg' returned a non-zero code: 1
With debugging
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe5d448aa10>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/ansible-modules-hashivault/
Could not find a version that satisfies the requirement ansible-modules-hashivault>=3.9.5 (from -r /_ansible/build/ansible-requirements.txt (line 3)) (from versions: )
No matching distribution found for ansible-modules-hashivault>=3.9.5 (from -r /_ansible/build/ansible-requirements.txt (line 3))
2018-07-11T02:23:28.583127 Cleaning up temporary directory [container.utils.temp] caller_file=/sources/ansible-container/container/utils/temp.py caller_func=__exit__ caller_line=22 path=/tmp/tmp5__sJy
2018-07-11T02:23:28.585547 Unknown exception Error building conductor image: The command '/bin/sh -c pip install --no-cache-dir -r /_ansible/build/ansible-requirements.txt && ansible-galaxy install -p /etc/ansible/roles -r /_ansible/build/requirements.yml && cp /_ansible/build/ansible.cfg /etc/ansible/ansible.cfg' returned a non-zero code: 1 [container.cli] caller_file=/usr/lib/python2.7/site-packages/structlog/stdlib.py caller_func=exception caller_line=95
Traceback (most recent call last):
File "/sources/ansible-container/container/cli.py", line 304, in __call__
getattr(core, u'hostcmd_{}'.format(args.subcommand))(**vars(args))
File "/sources/ansible-container/container/__init__.py", line 28, in __wrapped__
return fn(*args, **kwargs)
File "/sources/ansible-container/container/core.py", line 184, in hostcmd_build
environment=env_vars
File "/sources/ansible-container/container/docker/engine.py", line 107, in __wrapped__
return fn(self, *args, **kwargs)
File "/sources/ansible-container/container/__init__.py", line 28, in __wrapped__
return fn(*args, **kwargs)
File "/sources/ansible-container/container/docker/engine.py", line 1140, in build_conductor_image
"Error building conductor image: {0}".format(line['errorDetail']['message']))
AnsibleContainerException: Error building conductor image: The command '/bin/sh -c pip install --no-cache-dir -r /_ansible/build/ansible-requirements.txt && ansible-galaxy install -p /etc/ansible/roles -r /_ansible/build/requirements.yml && cp /_ansible/build/ansible.cfg /etc/ansible/ansible.cfg' returned a non-zero code: 1
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
Have an ansible-requirements.txt file to install necessary python modules during build time. The proxy settings in the container.yml are not being passed as build-arguments to the downstream container build. This is necessary because we need to set http_proxy, no_proxy, and https_proxy in order to do these external builds. The builds are failing because it is unable to reach the external network because the necessary environment variables are not being passed back to the downstream build.
STEPS TO REPRODUCE
EXPECTED RESULTS
Container builds
ACTUAL RESULTS
Without debugging
With debugging