04-02-2018 06:41 AM - edited 03-08-2019 02:28 PM
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"}
Solved! Go to Solution.
06-06-2018 05:47 PM
05-23-2018 01:44 AM
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
06-06-2018 05:47 PM
02-17-2019 05:35 AM
thanks Roger .. i had same issue .. resolved
02-18-2019 01:55 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide