Reputation: 1
I keep getting failed to import python library ansible-pylibssh with redhat while trying to run a simple cisco playbook.
Failed to import the required Python library (ansible-pylibssh) on devc-ansible-01's Python /usr/bin/python3.12. 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 is my play book:
---
- name: show version
hosts: routers
gather_facts: false
connection: network_cli
vars:
ansible_network_os: ios
tasks:
- name: run the show verison
ios_command:
commands:
- sh ip interfave brief
Inside my ansible.cfg file is this:
interpreter_python = /usr/bin/python3.
ansible_python_interpreter: /usr/bin/python3
host_key_checking =False
This is the output of my ansible --version:
ansible --version ansible [core 2.16.3] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.12/site-packages/ansible ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible
and this is the output of ansible-yislbssh:
[ansible-01 playbooks]$ pip3 show ansible-pylibssh
Name: ansible-pylibssh
Version: 1.2.0.post4
Summary: Python bindings for libssh client specific to Ansible use case
Home-page: https://github.com/ansible/pylibssh
Author: Ansible, Inc.
Author-email: info+github/ansible/[email protected]
License: LGPLv2+
Location: /home/user/.local/lib/python3.11/site-packages
Requires:
Required-by:
I don't know why it's failing.
I have installed the packages that the machine is complaining about and even added the interpreter but the playbook still fails.
Upvotes: 0
Views: 126