ShubhamTatvamasi / magma-galaxy

https://galaxy.ansible.com/shubhamtatvamasi/magma
BSD 3-Clause "New" or "Revised" License
13 stars 20 forks source link

Failed to import the required Python library (kubernetes) #6

Closed Alt-Shivam closed 1 year ago

Alt-Shivam commented 1 year ago

Env: ubuntu 20 lts

Issue:

PLAY [Configure Magma Orchestrator] **************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************
Wednesday 14 September 2022  20:22:14 +0530 (0:00:00.015)       0:00:00.015 *** 
ok: [192.168.5.123]

TASK [config : Register Orchestrator pod] ********************************************************************************************************************
Wednesday 14 September 2022  20:22:17 +0530 (0:00:02.701)       0:00:02.717 *** 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'kubernetes'
fatal: [192.168.5.123]: FAILED! => {"changed": false, "error": "No module named 'kubernetes'", "msg": "Failed to import the required Python library (kubernetes) on ubuntu'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"}

PLAY RECAP ***************************************************************************************************************************************************
192.168.5.123              : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Wednesday 14 September 2022  20:22:18 +0530 (0:00:01.066)       0:00:03.783 *** 
=============================================================================== 
gather_facts ------------------------------------------------------------ 2.70s
config ------------------------------------------------------------------ 1.07s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
total ------------------------------------------------------------------- 3.77s
Alt-Shivam commented 1 year ago

Ansible Version

ansible [core 2.13.3]
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
  jinja version = 3.0.3
  libyaml = True
ShubhamTatvamasi commented 1 year ago

First, you have to run prerequisites role.

Alt-Shivam commented 1 year ago

Resolved, Thanks @ShubhamTatvamasi