Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to silence paramiko CryptographyDeprecationWarnings in ansible [duplicate]

I'm running Ansible 2.7.6 on macOS.

Every time I run a playbook, I get the same warning over and over:

/usr/local/lib/python3.7/site-packages/paramiko/ecdsakey.py:164: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point

I know the problem is with the paramiko Python library that ansible is using. This is due to be fixed in the next version, but it's not out yet. Is there an easy way to suppress these warnings for now?

like image 738
Mike A Avatar asked Dec 22 '25 09:12

Mike A


1 Answers

Execute the following command before executing Ansible

export PYTHONWARNINGS=ignore::UserWarning

Alternatively, you can set it in ~/.bash_profile

like image 81
Shahrukh Khan Avatar answered Dec 24 '25 07:12

Shahrukh Khan