cisco.ios.ios_ping module – Tests reachability using ping from IOS switch.
Note
This module is part of the cisco.ios collection (version 4.6.1).
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.ios
.
To use it in a playbook, specify: cisco.ios.ios_ping
.
New in cisco.ios 1.0.0
Synopsis
Tests reachability using ping from switch to a remote destination.
For a general purpose network module, see the net_ping module.
For Windows targets, use the win_ping module instead.
For targets running Python, use the ping module instead.
Note
This module has a corresponding action plugin.
Aliases: ping
Parameters
Parameter |
Comments |
---|---|
Define echo type ip or ipv6. Choices:
|
|
Number of packets to send. |
|
The IP Address or hostname (resolvable by switch) of the remote node. |
|
Set the DF bit. Choices:
|
|
Force egress interface bypassing routing. |
|
LAN source interface for Ingress. |
|
The source IP Address. |
|
Determines if the expected result is success or fail. Choices:
|
|
specify timeout interval. |
|
The VRF to use for forwarding. |
Notes
Examples
- name: Test reachability to 198.51.100.251 using default vrf
cisco.ios.ios_ping:
dest: 198.51.100.251
- name: Test reachability to 198.51.100.252 using prod vrf
cisco.ios.ios_ping:
dest: 198.51.100.252
vrf: prod
afi: ip
- name: Test un reachability to 198.51.100.253 using default vrf
cisco.ios.ios_ping:
dest: 198.51.100.253
state: absent
- name: Test reachability to 198.51.100.250 using prod vrf and setting count and source
cisco.ios.ios_ping:
dest: 198.51.100.250
source: loopback0
vrf: prod
count: 20
- name: Test reachability to 198.51.100.249 using df-bit and size
cisco.ios.ios_ping:
dest: 198.51.100.249
df_bit: true
size: 1400
- name: Test reachability to ipv6 address
cisco.ios.ios_ping:
dest: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
afi: ipv6
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: |