mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #7044 from 42wim/devel
hint to install python-ssl on redhat systems
This commit is contained in:
commit
632eb18333
1 changed files with 6 additions and 1 deletions
|
@ -220,13 +220,18 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
||||||
handlers = []
|
handlers = []
|
||||||
info = dict(url=url)
|
info = dict(url=url)
|
||||||
|
|
||||||
|
distribution = get_distribution()
|
||||||
# Get validate_certs from the module params
|
# Get validate_certs from the module params
|
||||||
validate_certs = module.params.get('validate_certs', True)
|
validate_certs = module.params.get('validate_certs', True)
|
||||||
|
|
||||||
parsed = urlparse.urlparse(url)
|
parsed = urlparse.urlparse(url)
|
||||||
if parsed[0] == 'https':
|
if parsed[0] == 'https':
|
||||||
if not HAS_SSL and validate_certs:
|
if not HAS_SSL and validate_certs:
|
||||||
module.fail_json(msg='SSL validation is not available in your version of python. You can use validate_certs=no, however this is unsafe and not recommended')
|
if distribution == 'Redhat':
|
||||||
|
module.fail_json(msg='SSL validation is not available in your version of python. You can use validate_certs=no, however this is unsafe and not recommended. You can also install python-ssl from EPEL')
|
||||||
|
else:
|
||||||
|
module.fail_json(msg='SSL validation is not available in your version of python. You can use validate_certs=no, however this is unsafe and not recommended')
|
||||||
|
|
||||||
elif validate_certs:
|
elif validate_certs:
|
||||||
# do the cert validation
|
# do the cert validation
|
||||||
netloc = parsed[1]
|
netloc = parsed[1]
|
||||||
|
|
Loading…
Reference in a new issue