ansible debug troubleshooting - script failing

Hello, I am new to ansible and its troubleshooting. my ansible script is failing. below is output. could you advise why is the script failing?

<10.10.100.59> attempting to start connection
<10.10.100.59> using connection plugin network_cli
<10.10.100.31> attempting to start connection
<10.10.100.31> using connection plugin network_cli
<10.10.100.59> local domain socket does not exist, starting it
<10.10.100.59> control socket path is /Users/ljamm/.ansible/pc/f58522fe09
<10.10.100.59> local domain socket listeners started successfully
<10.10.100.31> local domain socket does not exist, starting it
<10.10.100.59> loaded cliconf plugin ios from path /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/plugins/cliconf/ios.py for network_os ios
<10.10.100.31> control socket path is /Users/ljamm/.ansible/pc/91c938f5a6
<10.10.100.59>
<10.10.100.31> local domain socket listeners started successfully
<10.10.100.59> local domain socket path is /Users/ljamm/.ansible/pc/f58522fe09
<10.10.100.31> loaded cliconf plugin ios from path /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/plugins/cliconf/ios.py for network_os ios
<10.10.100.31>
<10.10.100.31> local domain socket path is /Users/ljamm/.ansible/pc/91c938f5a6
[WARNING]: Ignoring timeout(10) for ios_facts
[WARNING]: Ignoring timeout(10) for ios_facts
Attempting python interpreter discovery
Attempting python interpreter discovery
<10.10.100.59> ESTABLISH LOCAL CONNECTION FOR USER: ljamm
<10.10.100.59> EXEC /bin/sh -c ‘echo PLATFORM; uname; echo FOUND; command -v ‘"’"’/usr/bin/python’“'”‘; command -v ‘"’“‘python3.7’”’“'; command -v '”‘“‘python3.6’”’“'; command -v '”‘“‘python3.5’”’“'; command -v '”‘“‘python2.7’”’“'; command -v '”‘“‘python2.6’”’“'; command -v '”‘"’/usr/libexec/platform-python’“'”‘; command -v ‘"’"’/usr/bin/python3’“'”‘; command -v ‘"’“‘python’”’"‘; echo ENDFOUND && sleep 0’
<10.10.100.31> ESTABLISH LOCAL CONNECTION FOR USER: ljamm
<10.10.100.31> EXEC /bin/sh -c ‘echo PLATFORM; uname; echo FOUND; command -v ‘"’"’/usr/bin/python’“'”‘; command -v ‘"’“‘python3.7’”’“'; command -v '”‘“‘python3.6’”’“'; command -v '”‘“‘python3.5’”’“'; command -v '”‘“‘python2.7’”’“'; command -v '”‘“‘python2.6’”’“'; command -v '”‘"’/usr/libexec/platform-python’“'”‘; command -v ‘"’"’/usr/bin/python3’“'”‘; command -v ‘"’“‘python’”’"‘; echo ENDFOUND && sleep 0’
Python interpreter discovery fallback (unsupported platform for extended discovery: darwin)
Using module file /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/modules/network/ios/ios_facts.py
Python interpreter discovery fallback (unsupported platform for extended discovery: darwin)
Pipelining is enabled.
<10.10.100.59> EXEC /bin/sh -c ‘/usr/bin/python && sleep 0’
Using module file /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/modules/network/ios/ios_facts.py
Pipelining is enabled.
<10.10.100.31> EXEC /bin/sh -c ‘/usr/bin/python && sleep 0’
fatal: [iosv-1]: FAILED! => {
“ansible_facts”: {},
“changed”: false,
“failed_modules”: {
“ios_facts”: {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“exception”: “WARNING: The below traceback may not be related to the actual failure.\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible_ios_facts_payload_rig_Ih/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 "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible_ios_facts_payload_rig_Ih/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 None] Unable to connect to port 22 on 10.10.100.59”,
“warnings”: [
“Platform darwin on host iosv-1 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https:docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.”
]
}
},
“msg”: “The following modules failed to execute: ios_facts\n”
}
fatal: [iosv-2]: FAILED! => {
“ansible_facts”: {},
“changed”: false,
“failed_modules”: {
“ios_facts”: {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“exception”: “WARNING: The below traceback may not be related to the actual failure.\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible_ios_facts_payload_ngRqZd/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 "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible_ios_facts_payload_ngRqZd/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 None] Unable to connect to port 22 on 10.10.100.31”,
“warnings”: [
“Platform darwin on host iosv-2 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https:docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.”
]
}
},
“msg”: “The following modules failed to execute: ios_facts\n”
}

PLAY RECAP ****************************************************************************************************
iosv-1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
iosv-2 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Wednesday 08 July 2020 21:01:31 -0400 (0:00:15.930) 0:00:16.016 ********

I also keep on getting following msgs:

TASK [show hostname] ************************************************************************************************************
Wednesday 08 July 2020 21:12:10 -0400 (0:00:00.090) 0:00:00.090 ********
[WARNING]: Platform darwin on host iosv-2 is using the discovered Python interpreter at /usr/bin/python, but future installation
of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
fatal: [iosv-2]: FAILED! => {“ansible_facts”: {“discovered_interpreter_python”: “/usr/bin/python”}, “changed”: false, “msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.31”}

This is a network related issue, and not related to ansible:

Unable to connect to port 22 on 10.10.100.31"

From Ansible controller try to ping or do telnet on the above machine on port 22 and past the output here.

Example:
telnet 10.10.100.31 22

You are not able to reach that machine, that is causing the grief.

Regards,
Ameya

Thx. I was able to ssh from command line so this isn’t network issue. is it because of python?

TASK [show hostname] ************************************************************************************************************
Wednesday 08 July 2020 21:12:10 -0400 (0:00:00.090) 0:00:00.090 ********
[WARNING]: Platform darwin on host iosv-2 is using the discovered Python interpreter at /usr/bin/python, but future installation
of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
fatal: [iosv-2]: FAILED! => {“ansible_facts”: {“discovered_interpreter_python”: “/usr/bin/python”}, “changed”: false, “msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.31”}

is it because of python? see below.

ljamm@ljamm 2_templates_conditionals % ansible --version
ansible 2.9.10
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/Users/ljamm/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible
executable location = /Library/Frameworks/Python.framework/Versions/3.7/bin/ansible
python version = 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16) [Clang 6.0 (clang-600.0.57)]
ljamm@ljamm 2_templates_conditionals %
ljamm@ljamm 2_templates_conditionals % python --version
Python 2.7.16
ljamm@ljamm 2_templates_conditionals %

https://docs.ansible.com/ansible/latest/user_guide/connection_details.html