Ansible.netcommon.network_cli не использует Python в venvPython

Программы на Python
Anonymous
Ansible.netcommon.network_cli не использует Python в venv

Сообщение Anonymous »

Я использую pyenv, venvs и поэтику для своей установки ansible.
Недавно я удалил установленные файлы системного pip. Новая вещь в Debian 12: вы больше не можете устанавливать пакеты через pip без принудительного использования.
Я заметил, что моя книга сценариев Cisco не активируется.
Это мой файл group_vars/switches.yml для моей книги пьес Switch.yml для коммутаторов Cisco.

Код: Выделить всё

---
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.ios.ios
ansible_network_cli_ssh_type: libssh
После установки всего в моем venv с помощью поэтической установки pkgs устанавливается нормально, а также работает ansible-pylibssh.
Когда запустив playbookwitches.yml, я получаю эту ошибку:

Код: Выделить всё

PLAY [Configuration of switches] **********************************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
fatal: [REDACTED]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"cisco.ios.ios_facts": {"failed": true, "invocation": {"module_args": {"available_network_resources": false, "gather_network_resources": null, "gather_subset": ["min"]}}, "msg": "Failed to import the required Python library (ansible-pylibssh) on REDACTED'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"}}, "msg": "The following modules failed to execute: cisco.ios.ios_facts\n"}
Даже при добавлении ansible_python_interpreter он пытается использовать /usr/bin/python3 вместо this python, который указывает на /root/.pyenv/shims/python

Подробнее здесь: https://stackoverflow.com/questions/770 ... on-in-venv

Вернуться в «Python»