ansible / ansible.builtin / v2.7.9 / module / ios_ping Tests reachability using ping from Cisco IOS network devices | "added in version" 2.4 of ansible.builtin" Authors: Jacob McGill (@jmcgill298) preview | supported by communityansible.builtin.ios_ping (v2.7.9) — module
pip
Install with pip install ansible==2.7.9
Tests reachability using ping from switch to a remote destination.
For a general purpose network module, see the M(net_ping) module.
For Windows targets, use the M(win_ping) module instead.
For targets running Python, use the M(ping) module instead.
- name: Test reachability to 10.10.10.10 using default vrf ios_ping: dest: 10.10.10.10
- name: Test reachability to 10.20.20.20 using prod vrf ios_ping: dest: 10.20.20.20 vrf: prod
- name: Test unreachability to 10.30.30.30 using default vrf ios_ping: dest: 10.30.30.30 state: absent
- name: Test reachability to 10.40.40.40 using prod vrf and setting count and source ios_ping: dest: 10.40.40.40 source: loopback0 vrf: prod count: 20
vrf: default: default description: - The VRF to use for forwarding. dest: description: - The IP Address or hostname (resolvable by switch) of the remote node. required: true count: default: 5 description: - Number of packets to send. state: choices: - absent - present default: present description: - Determines if the expected result is success or fail. source: description: - The source IP Address. provider: description: - B(Deprecated) - 'Starting with Ansible 2.5 we recommend using C(connection: network_cli).' - For more information please see the U(https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html). - HORIZONTALLINE - A dict object containing connection details. suboptions: auth_pass: description: - Specifies the password to use if required to enter privileged mode on the remote device. If I(authorize) is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_AUTH_PASS) will be used instead. type: str authorize: default: false description: - Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_AUTHORIZE) will be used instead. type: bool host: description: - Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. type: str password: description: - Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_PASSWORD) will be used instead. type: str port: description: - Specifies the port to use when building the connection to the remote device. type: int ssh_keyfile: description: - Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_SSH_KEYFILE) will be used instead. type: path timeout: description: - Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. type: int username: description: - Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_USERNAME) will be used instead. type: str type: dict
commands: description: Show the command sent. returned: always sample: - ping vrf prod 10.40.40.40 count 20 source loopback0 type: list packet_loss: description: Percentage of packets lost. returned: always sample: 0% type: str packets_rx: description: Packets successfully received. returned: always sample: 20 type: int packets_tx: description: Packets successfully transmitted. returned: always sample: 20 type: int rtt: description: Show RTT stats. returned: always sample: avg: 2 max: 8 min: 1 type: dict