When I got to "Lab 4: Ansible dynamic inventory for Azure" I ran into an error running azure_rm.py
[lab-user@ansibleMaster ~]$ python ./ansible/contrib/inventory/azure_rm.py --list
From cffi callback <function _verify_callback at 0x28a3c08>:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 313, in wrapper
_lib.X509_up_ref(x509)
AttributeError: 'module' object has no attribute 'X509_up_ref'
, SSLError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /f649c560-d5ad-47f8-9660-45061e79fa51/oauth2/token (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))
It would appear this issue has to do with 17.5.0 pyOpenSSL Release and a requirements.txt missing the version requirement on cryptography?
[lab-user@ansibleMaster ~]$ pip show cryptography
Name: cryptography
Version: 1.7.2
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
Author-email: [email protected]
License: BSD or Apache License, Version 2.0
Location: /usr/lib64/python2.7/site-packages
Requires: idna, pyasn1, six, setuptools, enum34, ipaddress, cffi
[lab-user@ansibleMaster ~]$ sudo pip install cryptography==2.1.4
Collecting cryptography==2.1.4
Downloading cryptography-2.1.4-cp27-cp27mu-manylinux1_x86_64.whl (2.2MB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 2.2MB 544kB/s
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography==2.1.4)
Downloading cffi-1.11.4-cp27-cp27mu-manylinux1_x86_64.whl (406kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 409kB 2.8MB/s
Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography==2.1.4)
Collecting asn1crypto>=0.21.0 (from cryptography==2.1.4)
Downloading asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 102kB 10.0MB/s
Requirement already satisfied: idna>=2.1 in /usr/lib/python2.7/site-packages (from cryptography==2.1.4)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python2.7/site-packages (from cryptography==2.1.4)
Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography==2.1.4)
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography==2.1.4)
Installing collected packages: cffi, asn1crypto, cryptography
Found existing installation: cffi 1.6.0
Uninstalling cffi-1.6.0:
Successfully uninstalled cffi-1.6.0
Found existing installation: cryptography 1.7.2
Uninstalling cryptography-1.7.2:
Successfully uninstalled cryptography-1.7.2
Successfully installed asn1crypto-0.24.0 cffi-1.11.4 cryptography-2.1.4