Ansible and Huawei

65 views
Skip to first unread message

Anurag Bhatia

unread,
Jan 3, 2019, 1:27:01 PM1/3/19
to ansible...@googlegroups.com
Hello there


Was wondering if anyone has experience of using ansible with Huawei successfully?
We are using Huawei at our IX and I am able to use ad-hoc commands with Huawei but playbooks based on documentation fail with a ncclient related error. We do have nc client as well as netconf installed on the machine. 



Our sample playbook (IP and access details are removed)


---
  - hosts: ###hidden###
    connection: local
    gather_facts: no
    vars:
      cli:
        host: ###hidden###
        port: ###hidden###
        username: ###hidden###
        password: ###hidden###
        transport: cli

    tasks:
    - name: Test port
      ce_switchport:
        interface: XGigabitEthernet0/0/44
        mode: access
        access_vlan: 100
        provider: '{{ cli }}'
        state: present




and this throws the following error during execution: 


The full traceback is:
Traceback (most recent call last):
  File "/usr/local/bin/ansible-connection", line 106, in start
    self.connection._connect()
  File "/Library/Python/2.7/site-packages/ansible/plugins/connection/netconf.py", line 288, in _connect
    ssh_config=ssh_config
  File "/Library/Python/2.7/site-packages/ncclient/manager.py", line 163, in connect
    return connect_ssh(*args, **kwds)
  File "/Library/Python/2.7/site-packages/ncclient/manager.py", line 128, in connect_ssh
    session.connect(*args, **kwds)
  File "/Library/Python/2.7/site-packages/ncclient/transport/ssh.py", line 485, in connect
    raise SSHError("Could not open connection, possibly due to unacceptable"
SSHError: Could not open connection, possibly due to unacceptable SSH subsystem name.

fatal: [$Host]: FAILED! => {
    "msg": "Could not open connection, possibly due to unacceptable SSH subsystem name."
}



Anyone with ideas on what could be wrong? 


Thanks! 


--


Anurag Bhatia

Ganesh Nalawade

unread,
Jan 4, 2019, 3:16:21 AM1/4/19
to Ansible Project
The error you are seeing is coming from ncclient library.
Are you able to connect to the device using a sample python script that uses ncclinet library?

Reference python script: https://github.com/ncclient/ncclient/blob/master/examples/nc01.py

Regards,
Ganesh

Anurag Bhatia

unread,
Jan 21, 2019, 6:35:35 AM1/21/19
to ansible...@googlegroups.com
Hi


Yes, tried that and it failed as well. Turned out netconf was not
enabled at the device and for some reason I am not able to enable it
either. Checking for device compatibility with netconf for now.

Anyways, thanks for your help and input Ganesh.
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/43884c30-4dff-406d-9464-e204a1afac89%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--


Anurag Bhatia
anuragbhatia.com
Reply all
Reply to author
Forward
0 new messages