Hello,
I am still new to ansible and have been trying to get a simple playbook
together using cisco IOS modules. I am testing with a Cisco Catalyst 3850
switch (running IOS XE 16.6.2) and at this stage am trying to collect the
config and safe it as a text file. I am running ansible 2.4.1, python 2.7.5
and this is my playbook, related files and the resulting error:
_____________________________________________________________
*backup.yaml*
---
- hosts: all
gather_facts: false
connection: local
tasks:
- name: Execute Show run command
ios_command:
commands:
- show run
host: "{{ ansible_host }}"
username: ansible
password: ansible
register: config
- name: Save the output to /etc/ansible/files
copy:
content: "{{ config.stdout[0] }}"
dest: "/etc/ansible/files/SHOW_RUN_{{ inventory_hostname }}.txt"
_____________________________________________________________
*ansible.cfg*
[defaults]
transport = local
host_key_checking = False
timeout = 5
[paramiko_connection]
host_key_auto_add = True
look_for_keys=False
[persistent_connection]
connect_timeout = 60
command_timeout = 30
_____________________________________________________________
*hosts*
[switches]
3850-TEST ansible_host=10.0.111.10
_____________________________________________________________
*ansible-playbook ansibleScripting/networkingTest/templates/backup.yaml*
PLAY [all]
**********************************************************************************************************************************************************************************
TASK [Execute Show run command]
*************************************************************************************************************************************************************
fatal: [3850-TEST]: FAILED! => {"changed": false, "failed": true, "msg":
"unable to open shell. Please see:
https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell"}
to retry, use: --limit
@/home/lukasm/ansibleScripting/networkingTest/templates/backup.retry
PLAY RECAP
**********************************************************************************************************************************************************************************
3850-TEST : ok=0 changed=0 unreachable=0 failed=1
_____________________________________________________________
I have tried to find this error and possible solutions for it in different
forums but the suggested solutions haven't worked for me yet. Any help
would be great as I am out of thoughts on what to do next.
Thanks,
Lukas
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/04ef8046-8538-4bfa-a294-248730fd96db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.