Description
What happened (please include outputs or screenshots):
Trying to deploy kubernetes module on an updated Rocky 9 remote machine result in the following error :
Failed to import the required Python library (kubernetes) on master's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter
This error is present despite having kubernetes
Python library previously installed on the remote machine.
If we login on the target machine, fire a Python3 interpreter, and try to manually import kubernetes
, we got the following error :
ImportError: cannot import name 'SIGNATURE_RSA' from 'oauthlib.oauth1'
What you expected to happen:
It should just work ?
Anything else we need to know?:
The bug resides in the kubernetes
module dependencies.
Your current requirements.txt
contains requests-oauthlib # ISC
.
Going on requests-oauthlib
repo, we can see that their requirements.txt
contains the following : oauthlib[signedtoken]==3.1.1
(available here https://github.com/requests/requests-oauthlib/blob/master/requirements.txt).
Upgrading oauthlib
Python library to >=3.2.0
solves the problem.
Environment:
$ pip list | grep kubernetes
kubernetes 25.3.0