首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到连接插件'ansible_connection: ansible.netcommon.netconf‘

找不到连接插件'ansible_connection: ansible.netcommon.netconf‘
EN

Stack Overflow用户
提问于 2021-11-08 15:43:27
回答 2查看 261关注 0票数 0

我正在尝试在Ansible上运行netconf。我已经通过pip3安装了ncclient,也通过Ansible-galaxy安装了netcommon。如果我做一个Ansible-galaxy列表,netcommon就会出现在列表中。我的ansible版本说它运行的是Python3.9,pip3说它也安装在3.9上。当我运行一个示例攻略时,我一直收到"the connection plugin 'ansible_connection: ansible.netcommon.netconf‘I not found“的提示,我遗漏了什么?

代码语言:javascript
运行
复制
root@3d99d84253c9:/app/app# cat /etc/ansible/ansible.cfg
[defaults]
host_key_checking = False
[ssh_connection]
-C -o ControlMaster=auto -o ControlPersist=60s -c aes128-cbc
root@3d99d84253c9:/app/app#
root@3d99d84253c9:/app/app# ansible --version
ansible [core 2.11.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.7 (default, Oct 12 2021, 02:54:29) [GCC 8.3.0]
  jinja version = 3.0.2
  libyaml = True
root@3d99d84253c9:/app/app#
root@3d99d84253c9:/app/app# cat test.yaml
---

- hosts: iosxr
  vars:

  become: no
  ignore_unreachable: true
  gather_facts: false

  pre_tasks:

  roles:

  tasks:
    - name: run command with json formatted output
      ansible.netcommon.cli_command:
        command: show version | json
root@3d99d84253c9:/app/app#
root@3d99d84253c9:/app/app# ansible-playbook -i inventory test.yaml

PLAY [iosxr] **************************************************************************************************************************************************************************************

TASK [run command with json formatted output] *****************************************************************************************************************************************************
fatal: [ATL_isr_lab]: FAILED! => {"msg": "the connection plugin 'ansible_connection: ansible.netcommon.netconf' was not found"}
fatal: [LAX_isr_lab]: FAILED! => {"msg": "the connection plugin 'ansible_connection: ansible.netcommon.netconf' was not found"}

PLAY RECAP ****************************************************************************************************************************************************************************************
ATL_isr_lab                : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
LAX_isr_lab                : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
EN

Stack Overflow用户

发布于 2021-11-08 23:44:30

找到我的问题了。我必须先在路由器上启用netconf。一旦我这样做了,这个剧本就开始起作用了。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69886195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档