Unset proxy environment variables before running Ansible#654
Merged
evgeni merged 1 commit intoJul 15, 2026
Conversation
ehelms
reviewed
Jul 14, 2026
Proxy env vars on the host cause Ansible HTTP tasks to route through the proxy and fail. Unsetting them in the wrapper script covers all playbooks, matching foreman-installer's approach, as similar to hooks/boot/05-environment.rb Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
Gauravtalreja1
force-pushed
the
unset-proxy-env-for-deploy
branch
from
July 15, 2026 10:03
97b56a6 to
30b8b51
Compare
evgeni
approved these changes
Jul 15, 2026
Contributor
Author
|
PRT passed on SatelliteQE/robottelo#22125 (remaining failures are unrelated to this changes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are you introducing these changes? (Problem description, related links)
When proxy environment variables (
http_proxy/HTTPS_PROXY) are set on the host, Ansible tasks that make HTTP calls (ansible.builtin.uri,theforeman.foremanmodules) route through the proxy and fail withTunnel connection failed: 503 Service Unavailable. This affects health checks, smart proxy registration, and service readiness checks.This is the same approach used by foreman-installer, which unsets proxy variables in
hooks/boot/05-environment.rbbefore running Puppet.Image pulls are unaffected, they go through Podman/systemd, which reads proxy settings from
/etc/containers/containers.conf, not from the shell environment.What are the changes introduced in this pull request?
http_proxy,HTTP_PROXY,https_proxy, andHTTPS_PROXYin theforemanctlwrapper script before invoking Ansible, so no playbook inherits proxy settings from the host environment.How to test this pull request
https_proxyset in the environmentforemanctl deploycompletes without proxy-related errorscontainers.conf)foremanctl healthSteps to reproduce:
export https_proxy=http://proxy.example.com:3128foremanctl deploy --foreman-initial-admin-password=changemeTunnel connection failed: 503Checklist