# cisco ios connect ssh error

**URL:** <https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337>\
**Category:** Ansible Project\
**Created:** [July 7, 2020, 7:33am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337 "2020-07-07T07:33:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandy.hung](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sandy.hung](https://forum.ansible.com/u/sandy.hung)\
**Post date:** [July 7, 2020, 7:33am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337/1 "2020-07-07T07:33:11Z")

</div>

I connect cisco switch run playbook show error msg  
please help thanks.

fatal: [tpesw-01]: FAILED! =\> {  
“ansible\_facts”: {},  
“changed”: false,  
“failed\_modules”: {  
“ios\_facts”: {  
“exception”: “WARNING: The below traceback may _not_ be related to the actual failure.\n File "/tmp/ansible\_ios\_facts\_payload\_8veYSP/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/network/common/network.py", line 229, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabilities()\n File "/tmp/ansible\_ios\_facts\_payload\_8veYSP/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/connection.py", line 185, in **rpc** \n raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n”,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“auth\_pass”: null,  
“authorize”: null,  
“gather\_network\_resources”: null,  
“gather\_subset”: [  
“all”  
],  
“host”: null,  
“password”: null,  
“port”: null,  
“provider”: null,  
“ssh\_keyfile”: null,  
“timeout”: null,  
“username”: null  
}  
},  
“msg”: “[Errno -2] Name or service not known”  
}  
},  
“msg”: “The following modules failed to execute: ios\_facts\n”  
}

---

<div class="post-metadata">

**Author:** ![Srinivas\_Naram](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Srinivas\_Naram](https://forum.ansible.com/u/Srinivas_Naram)\
**Post date:** [July 7, 2020, 7:49am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337/2 "2020-07-07T07:49:09Z")

</div>

Are you able to connect to Cisco Switch from Ansible server via ssh ? The error says ‘Connection Error’.

---

<div class="post-metadata">

**Author:** ![sandy.hung](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sandy.hung](https://forum.ansible.com/u/sandy.hung)\
**Post date:** [July 7, 2020, 9:20am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337/3 "2020-07-07T09:20:21Z")

</div>

Yes , I can connect ssh，but still show error

“ssh sandy@xxxx

Password:

— xxxx Global Limited —

\*\*\*\* Unauthorized access is strictly prohibited \*\*\* tpesw-01#

tpesw-01# “

fatal: [tpesw-01]: FAILED! =\> {

“ansible\_facts”: {},

“changed”: false,

“failed\_modules”: {

“ios\_facts”: {

“exception”: “WARNING: The below traceback may _not_ be related to t he actual failure.\n File "/tmp/ansible\_ios\_facts\_payload\_NZrxLz/ansible\_ios\_f acts\_payload.zip/ansible/module\_utils/network/common/network.py", line 229, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabil ities()\n File "/tmp/ansible\_ios\_facts\_payload\_NZrxLz/ansible\_ios\_facts\_payloa d.zip/ansible/module\_utils/connection.py", line 185, in **rpc** \n raise Conn ectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n”,

“failed”: true,

“invocation”: {

“module\_args”: {

“auth\_pass”: null,

“authorize”: null,

“gather\_network\_resources”: null,

“gather\_subset”: [

“all”

],

“host”: null,

“password”: null,

“port”: null,

“provider”: null,

“ssh\_keyfile”: null,

“timeout”: null,

“username”: null

}

},

“msg”: “[Errno -2] Name or service not known”

}

},

“msg”: “The following modules failed to execute: ios\_facts\n”

}

BR

Sandy

---

<div class="post-metadata">

**Author:** ![Srinivas\_Naram](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Srinivas\_Naram](https://forum.ansible.com/u/Srinivas_Naram)\
**Post date:** [July 7, 2020, 10:00am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337/4 "2020-07-07T10:00:31Z")

</div>

Username, Password is null. How are you passing user credentials ?

Would it be possible to share playbook ?

---

<div class="post-metadata">

**Author:** ![sandy.hung](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sandy.hung](https://forum.ansible.com/u/sandy.hung)\
**Post date:** [July 9, 2020, 9:28am UTC](https://forum.ansible.com/t/cisco-ios-connect-ssh-error/33337/5 "2020-07-09T09:28:24Z")

</div>

Thanks , I have solved.

BR

Sandy
