user12056706
user12056706

Reputation:

Cannot execute k8s module

My code in tasks/main.yml.

- name: Check Istio services
  k8s_info:
    api_version: v1
    kind: Service
    namespace: istio-system

But it returns;

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named kubernetes
fatal: [localhost]: FAILED! => {"changed": false, "error": "No module named kubernetes",

"msg": "Failed to import the required Python library (openshift) on Gihu's-MacBook-Pro.local's Python /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python.

Why does this issue happen?

Upvotes: 6

Views: 9728

Answers (3)

Kyle LI
Kyle LI

Reputation: 31

In my case, the error indicates that "ImportError: No module named kubernetes", so I tried with pip install anisble kubernetes, and it works~

Upvotes: 0

munene
munene

Reputation: 41

the install of the openshift (and really a whole ansible install) is required on the target host

Upvotes: 1

user12056706
user12056706

Reputation:

Execute command;

sudo pip install --upgrade --user openshift

Upvotes: 5

Related Questions