0

Have been researching a bit about libssh connection.. this libssh seems to have come up with setup as an alternative to the paramiko connection, basically interested in this as it multiple network modules which can be used with ssh and our ssh_common_args Has anyone tried this type of libssh connection from ansible shared env.?? https://docs.ansible.com/ansible/2.10/collections/ansible/netcommon/libssh_connection.html

the idea is to be able to use the ansible.netcomm modules, like below link https://www.ansible.com/blog/new-libssh-connection-plugin-for-ansible-network

Basically i am able to execute the normal ssh connectivity, and using the raw module to execute commands on network device shell.. but the libssh connectivity with ansible.netcommon.cli_command doesnot work, not sure how to get this working

'''
# Test a connection to network device
- name: Try connection test to box
  hosts: "{{ affected_host }}"
  gather_facts: false
  ignore_errors: true
  
  tasks:
    - name: Checking NW device Connectivity
      raw: show version
      register: cmdopt1
      
    - name: PRINT TO TERMINAL WINDOW
      debug:
        msg: "{{cmdopt1.stdout}}"
        
    - name: Checking NW device Connectivity
      ansible.netcommon.cli_command:
        command: show version
      register: cmdopt2
      
    - name: PRINT TO TERMINAL WINDOW
      debug:
        msg: "{{cmdopt2.stdout}}" 
'''
Deepak
  • 47
  • 4
  • When you wrote "doesnot work", you stopped typing before you finished writing "... because it does ..." or "... but the error is ..." – mdaniel Mar 24 '21 at 16:13
  • haha but the error is ERROR! couldn't resolve module/action 'ansible.netcommon.libssh'. This often indicates a misspelling, missing collection, or incorrect module path. – Deepak Apr 02 '21 at 03:27

0 Answers0