ansiblenetconf

the connection plugin 'ansible_connection: ansible.netcommon.netconf' was not found


I am trying to run netconf over Ansible. I have installed ncclient via pip3 as well as netcommon via Ansible-galaxy. If I do an Ansible-galaxy list netcommon shows up on the list. My ansible version says it is running python 3.9 and pip3 says it installed it on 3.9 as well. When I run a sample playbook, I keep getting "the connection plugin 'ansible_connection: ansible.netcommon.netconf' was not found" What am I missing?

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

Solution

  • The error message is the connection plugin 'ansible_connection: ansible.netcommon.netconf' was not found. This indicates that you have ansible_connection: "ansible_connection: ansible.netcommon.netconf" or the equivalent somewhere. You should remove the extraneous ansible_connection: .