*I could login the cisco device with SSH and run the show version 
successfully.*
-----------------------------------------------------------------------------------------------------------------
[root@peklnelh03 ansible]# ssh xxxx...@10.106.65.xxx
x...@10.106.65.xxx's password: 
**********************************************************************
This is a private property facility to be accessed and used for Lenovo
internal systems. Unauthorized Access Prohibited!
**********************************************************************
***********************************************************************
*  Warning Notice:                                                    *
*    ip verify reverse-path interface is not supported      *
Type help or '?' for a list of available commands.
CNSHPFW5510-01> show version

Cisco Adaptive Security Appliance Software Version 8.2(5)51 
Device Manager Version 5.2(4)
---------------------------------------------------------------------------------------------------------------------
*However, I run the ios_command with ansible, I got this error:*

*------------------------------------------------------------------------------------------------------------------------------------*
TASK [ios_command] 
*************************************************************
fatal: [10.106.65.xxx]: FAILED! => {"changed": false, "commands": "terminal 
length 0", "failed": true, "msg": "terminal length 0\r\n                 
^\r\nERROR: % Invalid input detected at '^' marker.\r\n\r> "}

- hosts: ios
  gather_facts: no
  connection: local

  tasks:
  - name: LOGIN
    include_vars: secrets.yaml

  - name: PROVIDER
    set_fact:
      provider:
        host: "{10.106.65.xxx}"
        username: "{xxx}"
        password: "{6785493@bcdD}"
        auth_pass: "{cisco}"
  - ios_command:
      host: "10.106.65.xxxxx"
      username: "xxxxxx"
      password: "6785493@bcdD"
      port: "22"
      commands:
        - show version
    register: version
  - debug: var=version.stdout_lines
---------------------------------------------------------------------------------------------------------------------
*Could someone give me some advice to fix this issue?*

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/baa49122-a4ec-4dc5-b1da-1d7fd17e3e47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to