cisco ios connect ssh error

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”
}

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

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

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

Would it be possible to share playbook ?

Thanks , I have solved.

BR

Sandy