How to use proxy while creating Execution Environments in disconnected Ansible Automation Platform 2.x setup ?

Solution Verified - Updated -

Environment

  • Red Hat® Ansible Automation Platform 2.x

Issue

Resolution

  • Need to set the proxy in execution-environment.yml like below:

    additional_build_steps:
    prepend: |
      export http_proxy=proxy.example.com
      export HTTP_PROXY=proxy.example.com
      export https_proxy=proxy.example.com
      export HTTPS_PROXY=proxy.example.com
    

Root Cause

  • There is a known open issue about the customization limitations with Ansible Builder.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

4 Comments

This option worked better for me with ansible-builder 1.1.0 and AAP 2.2: ansible-builder build --build-arg HTTP_PROXY=http://proxy.example.com:8080 --build-arg HTTPS_PROXY=http://proxy.example.com:8080 --build-arg http_proxy=http://proxy.example.com:8080 --build-arg https_proxy=http://proxy.example.com:8080 --build-arg NO_PROXY=internal.domain.xyz --build-arg no_proxy=internal-domain.xyz -f execution-environment-custom.yml -t custom -v 3

Patrick , this wont work for some solutions like zscaler where you have to define the proxy as http://localhost:9000 because localohost:9000 inside the container will be a different loopback interface. I wish there was a better way as you stated adding the variables in the solution did not work for me either.

This syntax will not work, the export should be replaced by "ENV" in the prepend section.

@Patrick Cunning this wont work for some solutions like zscaler where you have to define the proxy as http://localhost:9000 because localohost:9000 inside the container will be a different loopback interface.