.. _cisco.nxos.nxos_ping_module: ******************** cisco.nxos.nxos_ping ******************** **Tests reachability using ping from Nexus switch.** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Tests reachability using ping from switch to a remote destination. - For a general purpose network module, see the :ref:`ansible.netcommon.net_ping ` module. - For Windows targets, use the :ref:`ansible.windows.win_ping ` module instead. - For targets running Python, use the :ref:`ansible.builtin.ping ` module instead. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
count
integer
Default:
5
Number of packets to send.
dest
string / required
IP address or hostname (resolvable by switch) of remote node.
df_bit
boolean
    Choices:
  • no ←
  • yes
Set the DF bit.
size
integer
Size of packets to send.
source
string
Source IP Address or hostname (resolvable by switch)
state
string
    Choices:
  • absent
  • present ←
Determines if the expected result is success or fail.
vrf
string
Outgoing VRF.

Notes ----- .. note:: - Unsupported for Cisco MDS - For a general purpose network module, see the :ref:`ansible.netcommon.net_ping ` module. - For Windows targets, use the :ref:`ansible.windows.win_ping ` module instead. - For targets running Python, use the :ref:`ansible.builtin.ping ` module instead. - For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide ` - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide ` - For more information on using Ansible to manage Cisco devices see the `Cisco integration page `_. Examples -------- .. code-block:: yaml - name: Test reachability to 8.8.8.8 using mgmt vrf cisco.nxos.nxos_ping: dest: 8.8.8.8 vrf: management host: 68.170.147.165 - name: Test reachability to a few different public IPs using mgmt vrf cisco.nxos.nxos_ping: dest: "{{ item }}" vrf: management host: 68.170.147.165 with_items: - 8.8.8.8 - 4.4.4.4 - 198.6.1.4 - name: Test reachability to 8.8.8.8 using mgmt vrf, size and df-bit cisco.nxos.nxos_ping: dest: 8.8.8.8 df_bit: true size: 1400 vrf: management Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
commands
list
always
Show the command sent

Sample:
['ping 8.8.8.8 count 2 vrf management']
packet_loss
string
always
Percentage of packets lost

Sample:
0.00%
packets_rx
integer
always
Packets successfully received

Sample:
2
packets_tx
integer
always
Packets successfully transmitted

Sample:
2
rtt
dictionary
always
Show RTT stats

Sample:
{'avg': 6.264, 'max': 6.564, 'min': 5.978}


Status ------ Authors ~~~~~~~ - Jason Edelman (@jedelman8) - Gabriele Gerbino (@GGabriele)