diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 53c4133575f..e698d780ffb 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -44,6 +44,15 @@ try: except ImportError: HAVE_SELINUX=False +try: + # Check if we have SSLContext support + from ssl import create_default_context, SSLContext + del create_default_context + del SSLContext + HAS_SSLCONTEXT = True +except ImportError: + HAS_SSLCONTEXT = False + try: import json # Detect python-json which is incompatible and fallback to simplejson in @@ -794,7 +803,8 @@ class Facts(object): }, 'version_info': list(sys.version_info), 'executable': sys.executable, - 'type': sys.subversion[0] + 'type': sys.subversion[0], + 'has_sslcontext': HAS_SSLCONTEXT }