cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
5070
Views
5
Helpful
4
Replies

Ansible unable to open Cisco shell

Joshuabowers
Level 1
Level 1

Over the past few weeks I been studying Ansible, and last week I been receiving the error below on Cisco 3900,2800,3750-x devices. My Ansible version should be the same unless something auto updated within the week. Lastly, I can use the Linux command ssh josh@rtr1, so my machine has the access DNS / SSH access.

 

[root@localhost playbooks]# ansible --version
ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

 

fatal: [RTR3]: FAILED! => {"changed": false, "msg": "unable to open shell. Please see: https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell"}

 

 

1 Accepted Solution

Accepted Solutions

Roger, I found out my issue. Reinstalling ansible seemed to work. Plus this example playbook asks the user for creds during runtime. Since it doesnt run a job daily, I would rather the playbook to ask.

View solution in original post

4 Replies 4

roger perkin
Level 2
Level 2

If you can SSH to your device from the command line of your Ansible host, then this is most likely being caused by the way you are passing your credentials into the playbook? 

 

if you run your playbook with -u <your username> -k 

 

This will then prompt you for your password 

 

Try that and see if you get any better results 

 

 

Roger, I found out my issue. Reinstalling ansible seemed to work. Plus this example playbook asks the user for creds during runtime. Since it doesnt run a job daily, I would rather the playbook to ask.

thanks Roger .. i had same issue .. resolved

Great, but I now typically have the creds in either a group_vars or host_vars file 

 

Starting also to use Ansible Vault for production playbooks. 

 

 

Review Cisco Networking for a $25 gift card