# Test connectivity from AWX to devices in inventory

**URL:** <https://forum.ansible.com/t/test-connectivity-from-awx-to-devices-in-inventory/33218>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 19, 2020, 1:46pm UTC](https://forum.ansible.com/t/test-connectivity-from-awx-to-devices-in-inventory/33218 "2020-06-19T13:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [June 19, 2020, 1:46pm UTC](https://forum.ansible.com/t/test-connectivity-from-awx-to-devices-in-inventory/33218/1 "2020-06-19T13:46:09Z")

</div>

Hi All,

I’m trying to figure out how to test IP connectivity between AWX and a large list of network devices. I know that SSH connectivity will be blocked so using the ping module will fail. I tried to use the command module as below

tasks:

- name: “Test for IP reachbility to inventory target”  
shell: ping -c1 {{ ansible\_host }}  
delegate\_to: localhost

With the following results  
fatal: [router1 → localhost]: FAILED! =\> {“changed”: true, “cmd”: “ping -c1 192.168.100.1”, “delta”: “0:00:10.011693”, “end”: “2020-06-19 13:37:10.906005”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2020-06-19 13:37:00.894312”, “stderr”: “”, “stderr\_lines”: , “stdout”: “PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.\n\n— 192.168.100.1 ping statistics —\n1 packets transmitted, 0 received, 100% packet loss, time 0ms”, “stdout\_lines”: [“PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.”, “”, “— 192.168.100.1 ping statistics —”, “1 packets transmitted, 0 received, 100% packet loss, time 0ms”]}

When log into the awx\_task container and execute the same ping command from a bash shell it succeeds  
bash-4.4# ping -c1 192.168.100.1  
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.  
64 bytes from 192.168.100.1: icmp\_seq=1 ttl=246 time=1.55 ms

— 192.168.100.1 ping statistics —  
1 packets transmitted, 1 received, 0% packet loss, time 0ms  
rtt min/avg/max/mdev = 1.551/1.551/1.551/0.000 ms  
bash-4.4#

Does AWX set up some sort of restricted environment where tasks that are delegated to localhost are executed from? Is there anything that I can execute an equivalent task that is not bound by these restrictions?

Rod

---

<div class="post-metadata">

**Author:** ![Selvam\_Elangovan](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Selvam\_Elangovan](https://forum.ansible.com/u/Selvam_Elangovan)\
**Post date:** [June 19, 2020, 3:13pm UTC](https://forum.ansible.com/t/test-connectivity-from-awx-to-devices-in-inventory/33218/2 "2020-06-19T15:13:21Z")

</div>

As you are running as ansible command, please use ssh proxy parameter in extra var section.

---

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [June 19, 2020, 3:18pm UTC](https://forum.ansible.com/t/test-connectivity-from-awx-to-devices-in-inventory/33218/3 "2020-06-19T15:18:43Z")

</div>

Hi Selvam,

I don’t really understand your suggestion. The intention is to run the command on the awx\_task container which is why I set “delegate\_to: localhost” I don’t want to run it via SSH.

Best regards

Rod
