cisco.nxos.nxos_ping module – Tests reachability using ping from Nexus switch.
Note
This module is part of the cisco.nxos collection (version 8.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.nxos
.
To use it in a playbook, specify: cisco.nxos.nxos_ping
.
New in cisco.nxos 1.0.0
Synopsis
Tests reachability using ping from switch to a remote destination.
For a general purpose network module, see the ansible.netcommon.net_ping module.
For Windows targets, use the ansible.windows.win_ping module instead.
For targets running Python, use the ansible.builtin.ping module instead.
Aliases: ping
Parameters
Parameter |
Comments |
---|---|
Number of packets to send. Default: |
|
IP address or hostname (resolvable by switch) of remote node. |
|
Set the DF bit. Choices:
|
|
Size of packets to send. |
|
Source IP Address or hostname (resolvable by switch) |
|
Determines if the expected result is success or fail. Choices:
|
|
Outgoing VRF. |
Notes
Note
Unsupported for Cisco MDS
For a general purpose network module, see the ansible.netcommon.net_ping module.
For Windows targets, use the ansible.windows.win_ping module instead.
For targets running Python, use the ansible.builtin.ping module instead.
For information on using CLI and NX-API see the :ref:`NXOS Platform Options guide <nxos_platform_options>`
For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
For more information on using Ansible to manage Cisco devices see the `Cisco integration page <https://www.ansible.com/integrations/networks/cisco>`_.
Examples
- 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:
Key |
Description |
---|---|
Show the command sent Returned: always Sample: |
|
Percentage of packets lost Returned: always Sample: |
|
Packets successfully received Returned: always Sample: |
|
Packets successfully transmitted Returned: always Sample: |
|
Show RTT stats Returned: always Sample: |