This is rather odd, I noticed it yesterday on one of my target machines, and today its happening on the rest of them too. I also tried running the playbook from a different machine and the same thing happened. It seems like this problem occurs after an apt upgrade on Ubuntu 20.04. The first time the apt upgrade goes through, all is well, but after that the module begins to fail.
The error output is as follows:
TASK [common : Update package manager] *************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: module 'lib
' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
fatal: [mr-bones]: FAILED! => changed=false
module_stderr: |-
Traceback (most recent call last):
File "<stdin>", line 107, in <module>
File "<stdin>", line 99, in _ansiballz_main
File "<stdin>", line 47, in invoke_module
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_apt_payload_vpe7xcy0/ansible_apt_payload.zip/ansible/modules/apt.py", line 346, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/tmp/ansible_apt_payload_vpe7xcy0/ansible_apt_payload.zip/ansible/module_utils/urls.py", line 115, in <module>
File "/usr/local/lib/python3.8/dist-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.SSL
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
I should note that commands like sudo apt-get upgrade
work just fine on the target machine without ansible.
Has anyone else encountered this? Should I report this as a bug to the ansible folks on github?
EDIT: I did some more digging and apparently this affects other ansible modules like get_url, which points me to the idea that this is a Python/OpenSSL error, rather that something to do with apt