任务执行期间发生异常。要查看完整的回溯,请使用 -vvv。错误是:ModuleNotFoundError: No module named 'kubernetes'
failed: [ubuntu] (item={'name': 'deploymentnginx.yaml.j2'}) => {"ansible_loop_var": "item", "changed": false, "error": "No module named 'kubernetes'", "item": {"name": "deploymentnginx.yaml.j2"}, "msg": "Failed to import the required Python library (openshift) on ubuntu's Python /usr/bin/python3. Please read module documentation and install 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"}
Kubernetes 已安装,但仍然出现错误
(molecule-venv) root@picklock1:~/molecule-blog/mywebapp# pip list -o
Package Version Latest Type
---------- ------- ------- -----
ansible 2.9.0 4.9.0 sdist
Cerberus 1.3.2 1.3.4 sdist
kubernetes 12.0.0 19.15.0 wheel
pip 20.0.2 21.3.1 wheel
PyYAML 5.4.1 6.0 wheel
setuptools 44.0.0 59.4.0 wheel