Guard against REQUESTS_CA_BUNDLE pointing to a non-existent path - #186
Open
rohitthakur2590 wants to merge 4 commits into
Open
rohitthakur2590 wants to merge 4 commits into
rohitthakur2590 wants to merge 4 commits into
Conversation
The SSL_CERT_FILE -> REQUESTS_CA_BUNDLE shim now checks os.path.isfile() before applying the mapping. If the path does not exist on the controller (e.g. the installer sets SSL_CERT_FILE to a path on the remote host that has not been created yet, or only exists on the managed node), the mapping is skipped and a debug message is logged instead of letting requests raise "Could not find a suitable TLS CA certificate bundle, invalid path: ...". Previously the mapping was unconditional, which broke the containerized installer postinstall tasks that set SSL_CERT_FILE to a path that does not exist on the Ansible controller (AAP-75386). Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
The controller shell environment (set by a prior installer step) may already contain REQUESTS_CA_BUNDLE pointing to a path that does not yet exist on the controller when the ansible.platform action plugin runs. os.environ.copy() inherits it and passes it to the manager subprocess, causing requests to raise "Could not find a suitable TLS CA certificate bundle, invalid path: ...". Guard REQUESTS_CA_BUNDLE itself — regardless of whether it came from the shell env or task env — by removing it when os.path.isfile() returns False, so requests falls back to the system CA store instead of crashing. Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
|
DVCS PR Check Results: PR appears valid (JIRA key(s) found) |
komaldesai13
approved these changes
May 15, 2026
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.
Description
Type of Change
Self-Review Checklist
Testing Instructions
Prerequisites
Steps to Test
Expected Results
Additional Context
Required Actions
Screenshots/Logs