From 6ed4ca97a8315a49f0df2c0ba676386d6ac75024 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 18 Apr 2014 00:07:07 +0200 Subject: [PATCH] hint to install python-ssl on redhat systems --- lib/ansible/module_utils/urls.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index 76ee34d774..c6e667be6f 100644 --- a/lib/ansible/module_utils/urls.py +++ b/lib/ansible/module_utils/urls.py @@ -220,13 +220,18 @@ def fetch_url(module, url, data=None, headers=None, method=None, handlers = [] info = dict(url=url) + distribution = get_distribution() # Get validate_certs from the module params validate_certs = module.params.get('validate_certs', True) parsed = urlparse.urlparse(url) if parsed[0] == 'https': 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: # do the cert validation netloc = parsed[1]