mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-08 03:33:10 +00:00
Enable url lookup without a proxy
By introducing a use_proxy parameter to url lookup, the usage of proxy is totally controllable. (cherry picked from commit 11e4e5123532344740c61f1069b53387df290b9b) from #23811
This commit is contained in:
@@ -37,12 +37,13 @@ class LookupModule(LookupBase):
|
||||
|
||||
validate_certs = kwargs.get('validate_certs', True)
|
||||
split_lines = kwargs.get('split_lines', True)
|
||||
use_proxy = kwargs.get('use_proxy', True)
|
||||
|
||||
ret = []
|
||||
for term in terms:
|
||||
display.vvvv("url lookup connecting to %s" % term)
|
||||
try:
|
||||
response = open_url(term, validate_certs=validate_certs)
|
||||
response = open_url(term, validate_certs=validate_certs, use_proxy=use_proxy)
|
||||
except HTTPError as e:
|
||||
raise AnsibleError("Received HTTP error for %s : %s" % (term, str(e)))
|
||||
except URLError as e:
|
||||
|
||||
Reference in New Issue
Block a user