I can run other sh commands like sh version, sh ip int brief but the sh run doesn’t work on the cisco CSR. What I am missing here?
swapna@jumphost1:~/ansible$ ansible-playbook shrun.yml
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
PLAY [Backup show run (enable mode commands)] **********************************************************************************************************************************************************
[WARNING]: While constructing a mapping from /home/swapna/ansible/host_vars/cisco_csr.yml, line 1, column 1, found a duplicate dict key (ansible_host). Using last defined value only.
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
TASK [run enable level commands] ***********************************************************************************************************************************************************************
fatal: [cisco_csr]: FAILED! => {“changed”: false, “msg”: “show running-config\r\nshow running-config\r\n ^\r\n% Invalid input detected at ‘^’ marker.\r\n\r\nCSR2>”}
PLAY RECAP *********************************************************************************************************************************************************************************************
cisco_csr : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
swapna@jumphost1:~/ansible$
swapna@jumphost1:~/ansible$ cat shrun.yml
-
name: Backup show run (enable mode commands)
hosts: all
gather_facts: false
connection: localtasks:
-
name: run enable level commands
ios_command:
commands:
- show running-configregister: print_output
-
debug: var=print_output.stdout_lines
swapna@jumphost1:~/ansible$
-